summaryrefslogtreecommitdiffstats
path: root/ui/views
diff options
context:
space:
mode:
authorvarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-01 02:16:56 +0000
committervarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-01 02:16:56 +0000
commit446051dcc1024f82330f2990ae07e06e64ae2e7f (patch)
tree9da744a16657627b2d4ed39bcfbaf71d1db3c9be /ui/views
parent8e68ec8ff7f25ddd4190e55eb69634b1d196f30b (diff)
downloadchromium_src-446051dcc1024f82330f2990ae07e06e64ae2e7f.zip
chromium_src-446051dcc1024f82330f2990ae07e06e64ae2e7f.tar.gz
chromium_src-446051dcc1024f82330f2990ae07e06e64ae2e7f.tar.bz2
Prevents crash when a menu gets closed during drag. This only gets exposed with patch https://codereview.chromium.org/196213004/ applied. DesktopNativeWidgetAura::ViewRemoved should do the same as NativeWidgetAura::ViewRemoved and clean up the drag state by calling ResetTargetViewIfEquals for the submenu view.
The use case that exposes this is when a bookmark bar model gets reloaded (and menu drop down is closed) during a drag of a bookmark over the menu. BUG=349154 TEST=Open a new browser on a new tab page and immediately drag a bookmark over a bookmark bar drop down menu. After a few seconds the menu may close when bookmark menu model gets synced but the browser should not crash. Review URL: https://codereview.chromium.org/214083004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r--ui/views/widget/desktop_aura/desktop_native_widget_aura.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index ad32c09..12aec92 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -490,8 +490,7 @@ void DesktopNativeWidgetAura::InitNativeWidget(
window_tree_client_.reset(
new DesktopNativeWidgetAuraWindowTreeClient(host_->window()));
- drop_helper_.reset(new DropHelper(
- static_cast<internal::RootView*>(GetWidget()->GetRootView())));
+ drop_helper_.reset(new DropHelper(GetWidget()->GetRootView()));
aura::client::SetDragDropDelegate(content_window_, this);
tooltip_manager_.reset(new TooltipManagerAura(GetWidget()));
@@ -591,6 +590,8 @@ void DesktopNativeWidgetAura::ReorderNativeViews() {
}
void DesktopNativeWidgetAura::ViewRemoved(View* view) {
+ DCHECK(drop_helper_.get() != NULL);
+ drop_helper_->ResetTargetViewIfEquals(view);
}
void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name,