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

Unified Diff: ui/views/controls/menu/menu_controller.h

Issue 2876203003: Make shelf item can be dragged when context menu is opened.
Patch Set: TransferEvents only if it is needed. Created 3 years, 7 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/controls/menu/menu_controller.h
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index 16ac2d4bd9c3a746d667f5c2c41e45d186e6fe61..06a7939683df0b52f0af0db20937b933658cc4f1 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -121,6 +121,10 @@ class VIEWS_EXPORT MenuController
// nested menu. Ownership is not taken.
void AddNestedDelegate(internal::MenuControllerDelegate* delegate);
+ static void SetDoCancel(bool do_cancel) { do_cancel_ = do_cancel; }
+
+ static bool DoCancel() { return do_cancel_; }
+
// Returns the current exit type. This returns a value other than EXIT_NONE if
// the menu is being canceled.
ExitType exit_type() const { return exit_type_; }
@@ -667,6 +671,10 @@ class VIEWS_EXPORT MenuController
// (like a context menu).
bool is_combobox_;
+ // In order to make item can be dragged after context menu is opened. Cannot
+ // cancel existing touch events.
xiyuan 2017/05/15 19:20:52 Can we make the document from the perspective of m
minch1 2017/05/16 22:13:39 Done.
+ static bool do_cancel_;
xiyuan 2017/05/15 19:20:52 Why this needs to be static? We already have a sta
minch1 2017/05/15 22:16:34 But in shelf_view.cc where where we want to set th
xiyuan 2017/05/15 22:41:10 How about adding a new MenuRunner::RunTypes mask a
minch1 2017/05/16 22:13:39 Done.
+
// Set to true if the menu item was selected by touch.
bool item_selected_by_touch_;

Powered by Google App Engine
This is Rietveld 408576698