summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authormarshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 17:48:57 +0000
committermarshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 17:48:57 +0000
commite280edf8001ff5ed0c871196eb45ac38bdf950ff (patch)
treefabab4a71496fb9d7f63916e8ab3115c4aa7ba91 /views
parenta2cb812a4d1fa85fc864b96e70213b72a16cdd1b (diff)
downloadchromium_src-e280edf8001ff5ed0c871196eb45ac38bdf950ff.zip
chromium_src-e280edf8001ff5ed0c871196eb45ac38bdf950ff.tar.gz
chromium_src-e280edf8001ff5ed0c871196eb45ac38bdf950ff.tar.bz2
Modify WidgetWin::Init() such that it doesn't create the FocusManager if the window is style WS_CHILD and parented to the desktop. We intentionally set the parent to the desktop window to remove it from the FocusManager hierarchy while the window is hidden.
BUG=37698 TEST=NONE Was: http://codereview.chromium.org/812004 Review URL: http://codereview.chromium.org/790005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_win.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 5527190..8a83299 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -130,9 +130,12 @@ void WidgetWin::Init(gfx::NativeView parent, const gfx::Rect& bounds) {
drop_target_ = new DropTargetWin(root_view_.get());
if ((window_style() & WS_CHILD) == 0 ||
- WidgetWin::GetRootWidget(parent) == NULL) {
+ (WidgetWin::GetRootWidget(parent) == NULL &&
+ parent != GetDesktopWindow())) {
// Top-level widgets and child widgets who do not have a top-level widget
- // ancestor get a FocusManager.
+ // ancestor get a FocusManager. Child widgets parented to the desktop do not
+ // get a FocusManager because parenting to the desktop is the technique used
+ // to intentionally exclude a widget from the FocusManager hierarchy.
focus_manager_.reset(new FocusManager(this));
}