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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/bookmarks/bookmark_model.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/bookmarks/bookmark_node_data.h" 9 #include "chrome/browser/bookmarks/bookmark_node_data.h"
10 #include "chrome/browser/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/bookmarks/bookmark_utils.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 DCHECK(i != menu_id_to_node_map_.end()); 105 DCHECK(i != menu_id_to_node_map_.end());
106 const BookmarkNode* node = i->second; 106 const BookmarkNode* node = i->second;
107 if (node->is_url()) { 107 if (node->is_url()) {
108 return BookmarkBarView::CreateToolTipForURLAndTitle( 108 return BookmarkBarView::CreateToolTipForURLAndTitle(
109 screen_loc, node->url(), node->GetTitle(), profile_); 109 screen_loc, node->url(), node->GetTitle(), profile_);
110 } 110 }
111 return string16(); 111 return string16();
112 } 112 }
113 113
114 bool BookmarkMenuDelegate::IsTriggerableEvent(views::MenuItemView* menu, 114 bool BookmarkMenuDelegate::IsTriggerableEvent(views::MenuItemView* menu,
115 const views::MouseEvent& e) { 115 const views::Event& e) {
116 return event_utils::IsPossibleDispositionEvent(e); 116 return event_utils::IsPossibleDispositionEvent(e);
117 } 117 }
118 118
119 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) { 119 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) {
120 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); 120 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end());
121 121
122 const BookmarkNode* node = menu_id_to_node_map_[id]; 122 const BookmarkNode* node = menu_id_to_node_map_[id];
123 std::vector<const BookmarkNode*> selection; 123 std::vector<const BookmarkNode*> selection;
124 selection.push_back(node); 124 selection.push_back(node);
125 125
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) { 477 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) {
478 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin(); 478 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin();
479 i != node_to_menu_map_.end(); ++i) { 479 i != node_to_menu_map_.end(); ++i) {
480 MenuItemView* menu = i->second->GetMenuItemByID(id); 480 MenuItemView* menu = i->second->GetMenuItemByID(id);
481 if (menu) 481 if (menu)
482 return menu; 482 return menu;
483 } 483 }
484 484
485 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL; 485 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL;
486 } 486 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h ('k') | chrome/browser/ui/views/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698