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

Unified Diff: ui/views/widget/root_view.cc

Issue 12529012: Context menu on views must show on mouse down for non-WIN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 8 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
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 1092f2dbd6b95e285e08be18136387146af17342..dfc9d8a3230e614efec588caa28a7687861babda 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -433,7 +433,12 @@ bool RootView::OnMousePressed(const ui::MouseEvent& event) {
mouse_pressed_event.set_flags(event.flags() & ~ui::EF_IS_DOUBLE_CLICK);
drag_info_.Reset();
- DispatchEventToTarget(mouse_pressed_handler_, &mouse_pressed_event);
+ {
+ WidgetDeletionObserver widget_deletion_observer(widget_);
+ DispatchEventToTarget(mouse_pressed_handler_, &mouse_pressed_event);
+ if (!widget_deletion_observer.IsWidgetAlive())
+ return mouse_pressed_event.handled();
+ }
// The view could have removed itself from the tree when handling
// OnMousePressed(). In this case, the removal notification will have

Powered by Google App Engine
This is Rietveld 408576698