| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) { | 132 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) { |
| 133 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); | 133 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); |
| 134 | 134 |
| 135 const BookmarkNode* node = menu_id_to_node_map_[id]; | 135 const BookmarkNode* node = menu_id_to_node_map_[id]; |
| 136 std::vector<const BookmarkNode*> selection; | 136 std::vector<const BookmarkNode*> selection; |
| 137 selection.push_back(node); | 137 selection.push_back(node); |
| 138 | 138 |
| 139 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection, | 139 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection, |
| 140 ui::DispositionFromEventFlags(mouse_event_flags), | 140 ui::DispositionFromEventFlags(mouse_event_flags), |
| 141 profile_); | 141 profile_); |
| 142 RecordBookmarkLaunch(location_); | 142 RecordBookmarkLaunch(node, location_); |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu( | 145 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu( |
| 146 int id, | 146 int id, |
| 147 const ui::Event& event) { | 147 const ui::Event& event) { |
| 148 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && | 148 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && |
| 149 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; | 149 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool BookmarkMenuDelegate::GetDropFormats( | 152 bool BookmarkMenuDelegate::GetDropFormats( |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 BuildMenu(node, 0, submenu, next_menu_id); | 484 BuildMenu(node, 0, submenu, next_menu_id); |
| 485 } else { | 485 } else { |
| 486 NOTREACHED(); | 486 NOTREACHED(); |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| 491 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { | 491 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { |
| 492 return menu_id < min_menu_id_ || menu_id > max_menu_id_; | 492 return menu_id < min_menu_id_ || menu_id > max_menu_id_; |
| 493 } | 493 } |
| OLD | NEW |