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

Unified Diff: ui/views/controls/button/menu_button.cc

Issue 271863006: Fix gesture event handling in MenuButton (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl format Created 6 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/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 83af3c9f2e632ed36142ec51513c4b3d89284620..bd3efa45d20d560c6b3dc77a640ff4f87d718dd9 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -202,9 +202,11 @@ void MenuButton::OnMouseExited(const ui::MouseEvent& event) {
}
void MenuButton::OnGestureEvent(ui::GestureEvent* event) {
- if (state() != STATE_DISABLED && event->type() == ui::ET_GESTURE_TAP) {
- if (Activate())
- event->StopPropagation();
+ if (state() != STATE_DISABLED && event->type() == ui::ET_GESTURE_TAP &&
+ !Activate()) {
+ // When |Activate()| returns |false|, it means that a menu is shown and
+ // has handled the gesture event. So, there is no need to further process
+ // the gesture event here.
return;
}
TextButton::OnGestureEvent(event);
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.cc ('k') | ui/views/controls/button/menu_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698