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

Unified Diff: chrome/browser/ui/views/toolbar/wrench_menu.cc

Issue 1005873012: Makes bookmark menu lazily create menus and removes limits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years, 9 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: chrome/browser/ui/views/toolbar/wrench_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/wrench_menu.cc b/chrome/browser/ui/views/toolbar/wrench_menu.cc
index fb972ec886e351d66ab51c3460b045c9fdacaa4b..a1002d06165b73ef3307e91872da494b01694b83 100644
--- a/chrome/browser/ui/views/toolbar/wrench_menu.cc
+++ b/chrome/browser/ui/views/toolbar/wrench_menu.cc
@@ -817,13 +817,6 @@ void WrenchMenu::Init(ui::MenuModel* model) {
// so we get the taller menu style.
PopulateMenu(root_, model);
-#if !defined(NDEBUG)
- // Verify that the reserved command ID's for bookmarks menu are not used.
- for (int i = WrenchMenuModel::kMinBookmarkCommandId;
- i <= WrenchMenuModel::kMaxBookmarkCommandId; ++i)
- DCHECK(command_id_to_entry_.find(i) == command_id_to_entry_.end());
-#endif // !defined(NDEBUG)
-
int32 types = views::MenuRunner::HAS_MNEMONICS;
if (for_drop()) {
// We add NESTED_DRAG since currently the only operation to open the wrench
@@ -1198,6 +1191,9 @@ MenuItemView* WrenchMenu::AddMenuItem(MenuItemView* parent,
(command_id == -1 &&
model->GetTypeAt(model_index) == MenuModel::TYPE_SEPARATOR));
+ DCHECK(command_id < WrenchMenuModel::kMinBookmarkCommandId ||
+ command_id > WrenchMenuModel::kMaxBookmarkCommandId);
+
if (command_id > -1) { // Don't add separators to |command_id_to_entry_|.
// All command ID's should be unique except for IDC_SHOW_HISTORY which is
// in both wrench menu and RecentTabs submenu,

Powered by Google App Engine
This is Rietveld 408576698