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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
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/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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) { 131 void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) {
132 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end()); 132 DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end());
133 133
134 const BookmarkNode* node = menu_id_to_node_map_[id]; 134 const BookmarkNode* node = menu_id_to_node_map_[id];
135 std::vector<const BookmarkNode*> selection; 135 std::vector<const BookmarkNode*> selection;
136 selection.push_back(node); 136 selection.push_back(node);
137 137
138 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection, 138 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection,
139 ui::DispositionFromEventFlags(mouse_event_flags), 139 ui::DispositionFromEventFlags(mouse_event_flags),
140 profile_); 140 profile_);
141 RecordBookmarkLaunch(node, location_); 141 RecordBookmarkLaunch(GetBookmarkModel(), node, location_);
142 } 142 }
143 143
144 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu( 144 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu(
145 int id, 145 int id,
146 const ui::Event& event) { 146 const ui::Event& event) {
147 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && 147 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) &&
148 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; 148 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB;
149 } 149 }
150 150
151 bool BookmarkMenuDelegate::GetDropFormats( 151 bool BookmarkMenuDelegate::GetDropFormats(
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698