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

Unified Diff: trunk/src/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc

Issue 26546004: Revert 227675 "reland "views: change WrenchMenu to use each mode..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
===================================================================
--- trunk/src/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc (revision 227696)
+++ trunk/src/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc (working copy)
@@ -41,8 +41,7 @@
BookmarkMenuDelegate::BookmarkMenuDelegate(Browser* browser,
PageNavigator* navigator,
views::Widget* parent,
- int first_menu_id,
- int max_menu_id)
+ int first_menu_id)
: browser_(browser),
profile_(browser->profile()),
page_navigator_(navigator),
@@ -51,8 +50,6 @@
for_drop_(false),
parent_menu_item_(NULL),
next_menu_id_(first_menu_id),
- min_menu_id_(first_menu_id),
- max_menu_id_(max_menu_id),
real_delegate_(NULL),
is_mutating_model_(false),
location_(BOOKMARK_LAUNCH_LOCATION_NONE) {}
@@ -69,7 +66,6 @@
BookmarkLaunchLocation location) {
GetBookmarkModel()->AddObserver(this);
real_delegate_ = real_delegate;
- location_ = location;
if (parent) {
parent_menu_item_ = parent;
int initial_count = parent->GetSubmenu() ?
@@ -84,6 +80,8 @@
} else {
menu_ = CreateMenu(node, start_child_index, show_options);
}
+
+ location_ = location;
}
void BookmarkMenuDelegate::SetPageNavigator(PageNavigator* navigator) {
@@ -434,17 +432,12 @@
if (!node->IsVisible() || node->GetTotalNodeCount() == 1)
return; // No children, don't create a menu.
- int id = *next_menu_id;
- // Don't create the submenu if its menu ID will be outside the range allowed.
- if (IsOutsideMenuIdRange(id))
- return;
- (*next_menu_id)++;
-
if (!*added_separator) {
*added_separator = true;
menu->AppendSeparator();
}
-
+ int id = *next_menu_id;
+ (*next_menu_id)++;
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
gfx::ImageSkia* folder_icon = rb->GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
@@ -463,10 +456,6 @@
for (int i = start_child_index; i < parent->child_count(); ++i) {
const BookmarkNode* node = parent->GetChild(i);
const int id = *next_menu_id;
- // Don't create the item if its menu ID will be outside the range allowed.
- if (IsOutsideMenuIdRange(id))
- break;
-
(*next_menu_id)++;
menu_id_to_node_map_[id] = node;
@@ -487,7 +476,3 @@
}
}
}
-
-bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const {
- return menu_id < min_menu_id_ || menu_id > max_menu_id_;
-}

Powered by Google App Engine
This is Rietveld 408576698