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

Unified Diff: views/desktop/desktop_window_view.cc

Issue 7604024: views-desktop: Add the desktop-window as an observer for a widget when it gets added to the desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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: views/desktop/desktop_window_view.cc
diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc
index 3668c25f4e0e5b2d6288f8cc9f4f6c1cf0dac7ca..95aa1598e836e17a2d076632bdf2c76a97b3aa3b 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);
sky 2011/08/17 15:49:12 Shouldn't you only do this during an add? And shou
sadrul 2011/08/17 15:54:25 Indeed. I did that in a subsequent CL.
+ }
}
////////////////////////////////////////////////////////////////////////////////
« 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