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

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

Issue 7749011: Plumbs through changing navigator to bookmark menus. This is needed in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_node_data.h" 9 #include "chrome/browser/bookmarks/bookmark_node_data.h"
10 #include "chrome/browser/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/bookmarks/bookmark_utils.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (!other_folder->empty()) { 74 if (!other_folder->empty()) {
75 parent->AppendSeparator(); 75 parent->AppendSeparator();
76 BuildOtherFolderMenu(parent, &next_menu_id_); 76 BuildOtherFolderMenu(parent, &next_menu_id_);
77 } 77 }
78 } 78 }
79 } else { 79 } else {
80 menu_ = CreateMenu(node, start_child_index, show_options); 80 menu_ = CreateMenu(node, start_child_index, show_options);
81 } 81 }
82 } 82 }
83 83
84 void BookmarkMenuDelegate::SetPageNavigator(PageNavigator* navigator) {
85 page_navigator_ = navigator;
86 if (context_menu_.get())
87 context_menu_->SetPageNavigator(navigator);
88 }
89
84 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node, 90 void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node,
85 int start_index) { 91 int start_index) {
86 DCHECK(!parent_menu_item_); 92 DCHECK(!parent_menu_item_);
87 if (!node_to_menu_map_[node]) 93 if (!node_to_menu_map_[node])
88 CreateMenu(node, start_index, HIDE_OTHER_FOLDER); 94 CreateMenu(node, start_index, HIDE_OTHER_FOLDER);
89 menu_ = node_to_menu_map_[node]; 95 menu_ = node_to_menu_map_[node];
90 } 96 }
91 97
92 std::wstring BookmarkMenuDelegate::GetTooltipText( 98 std::wstring BookmarkMenuDelegate::GetTooltipText(
93 int id, 99 int id,
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) { 440 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) {
435 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin(); 441 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin();
436 i != node_to_menu_map_.end(); ++i) { 442 i != node_to_menu_map_.end(); ++i) {
437 MenuItemView* menu = i->second->GetMenuItemByID(id); 443 MenuItemView* menu = i->second->GetMenuItemByID(id);
438 if (menu) 444 if (menu)
439 return menu; 445 return menu;
440 } 446 }
441 447
442 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL; 448 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL;
443 } 449 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698