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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.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 | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 29a1abd5018378ff315df727a853307e714bce0d..bbb3f9bee9f6e3c5537d57940a23ef46a3b8836f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -163,8 +163,10 @@ class BookmarkButton : public views::TextButton {
return !tooltip->empty();
}
- virtual bool IsTriggerableEvent(const views::MouseEvent& e) OVERRIDE {
- return event_utils::IsPossibleDispositionEvent(e);
+ virtual bool IsTriggerableEvent(const views::Event& e) OVERRIDE {
+ return e.type() == ui::ET_GESTURE_TAP ||
+ e.type() == ui::ET_GESTURE_TAP_DOWN ||
+ event_utils::IsPossibleDispositionEvent(e);
}
virtual std::string GetClassName() const OVERRIDE {
@@ -211,14 +213,18 @@ class BookmarkFolderButton : public views::MenuButton {
return !tooltip->empty();
}
- virtual bool IsTriggerableEvent(const views::MouseEvent& e) OVERRIDE {
- // Left clicks should show the menu contents and right clicks should show
- // the context menu. They should not trigger the opening of underlying urls.
- if (e.flags() == ui::EF_LEFT_MOUSE_BUTTON ||
- e.flags() == ui::EF_RIGHT_MOUSE_BUTTON)
+ virtual bool IsTriggerableEvent(const views::Event& e) OVERRIDE {
+ // Left clicks and taps should show the menu contents and right clicks
+ // should show the context menu. They should not trigger the opening of
+ // underlying urls.
+ if (e.type() == ui::ET_GESTURE_TAP ||
+ (e.IsMouseEvent() && (e.flags() &
+ (ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON))))
return false;
- return browser::DispositionFromEventFlags(e.flags()) != CURRENT_TAB;
+ if (e.IsMouseEvent())
+ return browser::DispositionFromEventFlags(e.flags()) != CURRENT_TAB;
+ return false;
}
virtual void OnPaint(gfx::Canvas* canvas) {
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698