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

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.h

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, 8 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
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 #ifndef CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 DISALLOW_COPY_AND_ASSIGN(ToolsMenuModel); 121 DISALLOW_COPY_AND_ASSIGN(ToolsMenuModel);
122 }; 122 };
123 123
124 // A menu model that builds the contents of the wrench menu. 124 // A menu model that builds the contents of the wrench menu.
125 class WrenchMenuModel : public ui::SimpleMenuModel, 125 class WrenchMenuModel : public ui::SimpleMenuModel,
126 public ui::SimpleMenuModel::Delegate, 126 public ui::SimpleMenuModel::Delegate,
127 public ui::ButtonMenuItemModel::Delegate, 127 public ui::ButtonMenuItemModel::Delegate,
128 public TabStripModelObserver, 128 public TabStripModelObserver,
129 public content::NotificationObserver { 129 public content::NotificationObserver {
130 public: 130 public:
131 // Range of command ID's to use for the items representing bookmarks in the 131 // Range of command ID's to use for the items in the recent tabs submenu.
Peter Kasting 2015/03/30 21:35:24 Nit: ID's -> IDs (while you're here)
sky 2015/03/31 15:17:39 Done.
132 // bookmark menu, must not overlap with that for recent tabs submenu.
133 static const int kMinBookmarkCommandId = 1;
134 static const int kMaxBookmarkCommandId = 1000;
135
136 // Range of command ID's to use for the items in the recent tabs submenu, must
137 // not overlap with that for bookmarks.
138 static const int kMinRecentTabsCommandId = 1001; 132 static const int kMinRecentTabsCommandId = 1001;
139 static const int kMaxRecentTabsCommandId = 1200; 133 static const int kMaxRecentTabsCommandId = 1200;
140 134
141 WrenchMenuModel(ui::AcceleratorProvider* provider, Browser* browser); 135 WrenchMenuModel(ui::AcceleratorProvider* provider, Browser* browser);
142 ~WrenchMenuModel() override; 136 ~WrenchMenuModel() override;
143 137
144 // Overridden for ButtonMenuItemModel::Delegate: 138 // Overridden for ButtonMenuItemModel::Delegate:
145 bool DoesCommandIdDismissMenu(int command_id) const override; 139 bool DoesCommandIdDismissMenu(int command_id) const override;
146 140
147 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: 141 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel:
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 Browser* browser_; // weak 244 Browser* browser_; // weak
251 TabStripModel* tab_strip_model_; // weak 245 TabStripModel* tab_strip_model_; // weak
252 246
253 scoped_ptr<content::HostZoomMap::Subscription> browser_zoom_subscription_; 247 scoped_ptr<content::HostZoomMap::Subscription> browser_zoom_subscription_;
254 content::NotificationRegistrar registrar_; 248 content::NotificationRegistrar registrar_;
255 249
256 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); 250 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel);
257 }; 251 };
258 252
259 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ 253 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698