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

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

Issue 10546104: Make IsTriggerableEvent take Event objects and use it to verify whether tap events should trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass Event to ShouldEnterPushedState. Created 8 years, 6 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
« no previous file with comments | « ui/views/controls/button/button_dropdown.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/button_dropdown.cc
diff --git a/ui/views/controls/button/button_dropdown.cc b/ui/views/controls/button/button_dropdown.cc
index 3fcfb6140047da7df0e3cd97724a8d91acdf5e0f..3a0e8668fa1ed2112d75e240061a42c1a771847e 100644
--- a/ui/views/controls/button/button_dropdown.cc
+++ b/ui/views/controls/button/button_dropdown.cc
@@ -123,11 +123,13 @@ void ButtonDropDown::GetAccessibleState(ui::AccessibleViewState* state) {
state->state = ui::AccessibilityTypes::STATE_HASPOPUP;
}
-bool ButtonDropDown::ShouldEnterPushedState(const MouseEvent& event) {
- // Enter PUSHED state on press with Left or Right mouse button. Remain
- // in this state while the context menu is open.
- return ((ui::EF_LEFT_MOUSE_BUTTON |
- ui::EF_RIGHT_MOUSE_BUTTON) & event.flags()) != 0;
+bool ButtonDropDown::ShouldEnterPushedState(const Event& event) {
+ // Enter PUSHED state on press with Left or Right mouse button or on taps.
+ // Remain in this state while the context menu is open.
+ return event.type() == ui::ET_GESTURE_TAP ||
+ event.type() == ui::ET_GESTURE_TAP_DOWN ||
+ (event.IsMouseEvent() && ((ui::EF_LEFT_MOUSE_BUTTON |
+ ui::EF_RIGHT_MOUSE_BUTTON) & event.flags()) != 0);
}
void ButtonDropDown::ShowDropDownMenu(gfx::NativeView window) {
« no previous file with comments | « ui/views/controls/button/button_dropdown.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698