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

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

Issue 306293006: Introduce ChromeBookmarkClientFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@364865
Patch Set: Add missing dependency in components/policy/policy_browser.gypi Created 6 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
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_factory.h" 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
11 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
11 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" 13 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h"
13 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 14 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 16 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
16 #include "chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.h" 17 #include "chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.h"
17 #include "chrome/browser/ui/views/event_utils.h" 18 #include "chrome/browser/ui/views/event_utils.h"
18 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
19 #include "components/bookmarks/browser/bookmark_model.h" 20 #include "components/bookmarks/browser/bookmark_model.h"
20 #include "content/public/browser/page_navigator.h" 21 #include "content/public/browser/page_navigator.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 page_navigator_ = navigator; 102 page_navigator_ = navigator;
102 if (context_menu_.get()) 103 if (context_menu_.get())
103 context_menu_->SetPageNavigator(navigator); 104 context_menu_->SetPageNavigator(navigator);
104 } 105 }
105 106
106 BookmarkModel* BookmarkMenuDelegate::GetBookmarkModel() { 107 BookmarkModel* BookmarkMenuDelegate::GetBookmarkModel() {
107 return BookmarkModelFactory::GetForProfile(profile_); 108 return BookmarkModelFactory::GetForProfile(profile_);
108 } 109 }
109 110
110 ChromeBookmarkClient* BookmarkMenuDelegate::GetChromeBookmarkClient() { 111 ChromeBookmarkClient* BookmarkMenuDelegate::GetChromeBookmarkClient() {
111 return BookmarkModelFactory::GetChromeBookmarkClientForProfile(profile_); 112 return ChromeBookmarkClientFactory::GetForProfile(profile_);
112 } 113 }
113 114
114 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node, 115 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node,
115 int start_index) { 116 int start_index) {
116 DCHECK(!parent_menu_item_); 117 DCHECK(!parent_menu_item_);
117 if (!node_to_menu_map_[node]) 118 if (!node_to_menu_map_[node])
118 CreateMenu(node, start_index, HIDE_PERMANENT_FOLDERS); 119 CreateMenu(node, start_index, HIDE_PERMANENT_FOLDERS);
119 menu_ = node_to_menu_map_[node]; 120 menu_ = node_to_menu_map_[node];
120 } 121 }
121 122
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 BuildMenu(node, 0, submenu, next_menu_id); 516 BuildMenu(node, 0, submenu, next_menu_id);
516 } else { 517 } else {
517 NOTREACHED(); 518 NOTREACHED();
518 } 519 }
519 } 520 }
520 } 521 }
521 522
522 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { 523 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const {
523 return menu_id < min_menu_id_ || menu_id > max_menu_id_; 524 return menu_id < min_menu_id_ || menu_id > max_menu_id_;
524 } 525 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698