summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/constrained_window_win.cc
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 20:57:15 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 20:57:15 +0000
commitf0c947d9619c86e5ed0f224fa3df8add6ae7da4e (patch)
treef1380d81e7b28fa8b10a0a140bc27be3ee95e26f /chrome/browser/ui/views/constrained_window_win.cc
parent2c5d73581a2d495d657cf2043c4680dd9490cf49 (diff)
downloadchromium_src-f0c947d9619c86e5ed0f224fa3df8add6ae7da4e.zip
chromium_src-f0c947d9619c86e5ed0f224fa3df8add6ae7da4e.tar.gz
chromium_src-f0c947d9619c86e5ed0f224fa3df8add6ae7da4e.tar.bz2
Keep visibility state in sync between the native window and view
Native ConstrainedWindows are invisible upon creation on Windows. Mark the associated NonClientView as hidden to keep the visibility state in sync. BUG=69673 TEST=none Review URL: http://codereview.chromium.org/6261015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/constrained_window_win.cc')
-rw-r--r--chrome/browser/ui/views/constrained_window_win.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc
index b2270ef..920be4b 100644
--- a/chrome/browser/ui/views/constrained_window_win.cc
+++ b/chrome/browser/ui/views/constrained_window_win.cc
@@ -571,6 +571,9 @@ void ConstrainedWindowWin::FocusConstrainedWindow() {
}
void ConstrainedWindowWin::ShowConstrainedWindow() {
+ // We marked the view as hidden during construction. Mark it as
+ // visible now so FocusManager will let us receive focus.
+ GetNonClientView()->SetVisible(true);
if (owner_->delegate())
owner_->delegate()->WillShowConstrainedWindow(owner_);
ActivateConstrainedWindow();
@@ -614,6 +617,10 @@ ConstrainedWindowWin::ConstrainedWindowWin(
set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION |
WS_THICKFRAME | WS_SYSMENU);
set_focus_on_creation(false);
+ // Views default to visible. Since we are creating a window that is
+ // not visible (no WS_VISIBLE), mark our View as hidden so that
+ // FocusManager can deal with it properly.
+ GetNonClientView()->SetVisible(false);
WindowWin::Init(owner_->GetNativeView(), gfx::Rect());
}