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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 10 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 void BookmarkMenuDelegate::SetPageNavigator(PageNavigator* navigator) { | 114 void BookmarkMenuDelegate::SetPageNavigator(PageNavigator* navigator) { |
115 page_navigator_ = navigator; | 115 page_navigator_ = navigator; |
116 if (context_menu_.get()) | 116 if (context_menu_.get()) |
117 context_menu_->SetPageNavigator(navigator); | 117 context_menu_->SetPageNavigator(navigator); |
118 } | 118 } |
119 | 119 |
120 const BookmarkModel* BookmarkMenuDelegate::GetBookmarkModel() const { | 120 const BookmarkModel* BookmarkMenuDelegate::GetBookmarkModel() const { |
121 return BookmarkModelFactory::GetForProfile(profile_); | 121 return BookmarkModelFactory::GetForBrowserContext(profile_); |
122 } | 122 } |
123 | 123 |
124 bookmarks::ManagedBookmarkService* | 124 bookmarks::ManagedBookmarkService* |
125 BookmarkMenuDelegate::GetManagedBookmarkService() { | 125 BookmarkMenuDelegate::GetManagedBookmarkService() { |
126 return ManagedBookmarkServiceFactory::GetForProfile(profile_); | 126 return ManagedBookmarkServiceFactory::GetForProfile(profile_); |
127 } | 127 } |
128 | 128 |
129 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node, | 129 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node, |
130 int start_index) { | 130 int start_index) { |
131 DCHECK(!parent_menu_item_); | 131 DCHECK(!parent_menu_item_); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 } | 544 } |
545 AddMenuToMaps(child_menu_item, node); | 545 AddMenuToMaps(child_menu_item, node); |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 void BookmarkMenuDelegate::AddMenuToMaps(MenuItemView* menu, | 549 void BookmarkMenuDelegate::AddMenuToMaps(MenuItemView* menu, |
550 const BookmarkNode* node) { | 550 const BookmarkNode* node) { |
551 menu_id_to_node_map_[menu->GetCommand()] = node; | 551 menu_id_to_node_map_[menu->GetCommand()] = node; |
552 node_to_menu_map_[node] = menu; | 552 node_to_menu_map_[node] = menu; |
553 } | 553 } |
OLD | NEW |