From aab6916887fca00a37ea6b2c3644398337cdbd3a Mon Sep 17 00:00:00 2001 From: "asanka@chromium.org" Date: Sat, 12 Mar 2011 04:02:15 +0000 Subject: Avoid dangling references to Views from FocusManager. When handling a native view hierarchy change, make sure any Views that are going to become disassociated from the FocusManager are removed from focus. BUG=75172 TEST=none Review URL: http://codereview.chromium.org/6670010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77918 0039d316-1c4b-4281-b951-d872f2087c98 --- views/controls/native/native_view_host_win.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/controls/native') diff --git a/views/controls/native/native_view_host_win.cc b/views/controls/native/native_view_host_win.cc index dbb8461..f8bda8e 100644 --- a/views/controls/native/native_view_host_win.cc +++ b/views/controls/native/native_view_host_win.cc @@ -43,7 +43,7 @@ void NativeViewHostWin::NativeViewAttached() { NativeWidget::GetAllNativeWidgets(host_->native_view(), &widgets); for (NativeWidget::NativeWidgets::iterator it = widgets.begin(); it != widgets.end(); ++it) { - (*it)->GetWidget()->GetRootView()->NotifyNativeViewHierarchyChanged( + (*it)->GetWidget()->NotifyNativeViewHierarchyChanged( true, host_->GetWidget()->GetNativeView()); } @@ -58,7 +58,7 @@ void NativeViewHostWin::NativeViewDetaching(bool destroyed) { NativeWidget::GetAllNativeWidgets(host_->native_view(), &widgets); for (NativeWidget::NativeWidgets::iterator it = widgets.begin(); it != widgets.end(); ++it) { - (*it)->GetWidget()->GetRootView()->NotifyNativeViewHierarchyChanged( + (*it)->GetWidget()->NotifyNativeViewHierarchyChanged( false, host_->GetWidget()->GetNativeView()); } -- cgit v1.1