| OLD | NEW |
| 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_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 string16 BookmarkMenuDelegate::GetTooltipText( | 103 string16 BookmarkMenuDelegate::GetTooltipText( |
| 104 int id, | 104 int id, |
| 105 const gfx::Point& screen_loc) const { | 105 const gfx::Point& screen_loc) const { |
| 106 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); | 106 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); |
| 107 | 107 |
| 108 MenuIDToNodeMap::const_iterator i = menu_id_to_node_map_.find(id); | 108 MenuIDToNodeMap::const_iterator i = menu_id_to_node_map_.find(id); |
| 109 DCHECK(i != menu_id_to_node_map_.end()); | 109 DCHECK(i != menu_id_to_node_map_.end()); |
| 110 const BookmarkNode* node = i->second; | 110 const BookmarkNode* node = i->second; |
| 111 if (node->is_url()) { | 111 if (node->is_url()) { |
| 112 return BookmarkBarView::CreateToolTipForURLAndTitle( | 112 return BookmarkBarView::CreateToolTipForURLAndTitle( |
| 113 screen_loc, node->url(), node->GetTitle(), profile_); | 113 screen_loc, node->url(), node->GetTitle(), profile_, |
| 114 parent()->GetNativeView()); |
| 114 } | 115 } |
| 115 return string16(); | 116 return string16(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 bool BookmarkMenuDelegate::IsTriggerableEvent(views::MenuItemView* menu, | 119 bool BookmarkMenuDelegate::IsTriggerableEvent(views::MenuItemView* menu, |
| 119 const ui::Event& e) { | 120 const ui::Event& e) { |
| 120 return e.type() == ui::ET_GESTURE_TAP || | 121 return e.type() == ui::ET_GESTURE_TAP || |
| 121 e.type() == ui::ET_GESTURE_TAP_DOWN || | 122 e.type() == ui::ET_GESTURE_TAP_DOWN || |
| 122 event_utils::IsPossibleDispositionEvent(e); | 123 event_utils::IsPossibleDispositionEvent(e); |
| 123 } | 124 } |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) { | 492 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) { |
| 492 for (NodeToMenuMap::const_iterator i(node_to_menu_map_.begin()); | 493 for (NodeToMenuMap::const_iterator i(node_to_menu_map_.begin()); |
| 493 i != node_to_menu_map_.end(); ++i) { | 494 i != node_to_menu_map_.end(); ++i) { |
| 494 MenuItemView* menu = i->second->GetMenuItemByID(id); | 495 MenuItemView* menu = i->second->GetMenuItemByID(id); |
| 495 if (menu) | 496 if (menu) |
| 496 return menu; | 497 return menu; |
| 497 } | 498 } |
| 498 | 499 |
| 499 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL; | 500 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL; |
| 500 } | 501 } |
| OLD | NEW |