Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3305)

Unified Diff: chrome/browser/ui/views/constrained_window_win.cc

Issue 6261015: Keep visibility state in sync between the native window and view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/constrained_window_win.cc
diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc
index b2270efa640be4e820ce9bb1f346a43c7e2575b9..920be4b40125524f5234123797498f288d4fc3cd 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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698