diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 04:38:56 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 04:38:56 +0000 |
commit | f7566289a12f6b31cce742849c1a97af3f9f1b77 (patch) | |
tree | 6eab82703ed0d24b9b78f2499522265335fb330a /views | |
parent | dd81a7cffbcd74216cfa630b02b3109401a448bd (diff) | |
download | chromium_src-f7566289a12f6b31cce742849c1a97af3f9f1b77.zip chromium_src-f7566289a12f6b31cce742849c1a97af3f9f1b77.tar.gz chromium_src-f7566289a12f6b31cce742849c1a97af3f9f1b77.tar.bz2 |
views-desktop: Add the desktop-window as an observer for a widget when it gets added to the desktop.
This fixes sending keyboard events to the browser in views-desktop.
TBR=sky@chromium.org
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7604024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/desktop/desktop_window_view.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc index 3668c25..95aa159 100644 --- a/views/desktop/desktop_window_view.cc +++ b/views/desktop/desktop_window_view.cc @@ -176,8 +176,14 @@ void DesktopWindowView::ViewHierarchyChanged( bool is_add, View* parent, View* child) { if (!is_add && active_native_widget_ && - active_native_widget_->GetView() == child) + active_native_widget_->GetView() == child) { active_native_widget_ = NULL; + } else if (child->GetClassName() == + internal::NativeWidgetView::kViewClassName) { + internal::NativeWidgetView* native_widget_view = + static_cast<internal::NativeWidgetView*>(child); + native_widget_view->GetAssociatedWidget()->AddObserver(this); + } } //////////////////////////////////////////////////////////////////////////////// |