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

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

Issue 26350003: OLD: reland "views: change WrenchMenu to use each model's command ID's when creating MenuItemView's" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integer overflow w/ kint32max, add test 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/ui/tabs/tab_strip_model_observer.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 DISALLOW_COPY_AND_ASSIGN(ToolsMenuModel); 72 DISALLOW_COPY_AND_ASSIGN(ToolsMenuModel);
73 }; 73 };
74 74
75 // A menu model that builds the contents of the wrench menu. 75 // A menu model that builds the contents of the wrench menu.
76 class WrenchMenuModel : public ui::SimpleMenuModel, 76 class WrenchMenuModel : public ui::SimpleMenuModel,
77 public ui::SimpleMenuModel::Delegate, 77 public ui::SimpleMenuModel::Delegate,
78 public ui::ButtonMenuItemModel::Delegate, 78 public ui::ButtonMenuItemModel::Delegate,
79 public TabStripModelObserver, 79 public TabStripModelObserver,
80 public content::NotificationObserver { 80 public content::NotificationObserver {
81 public: 81 public:
82 // Range of command ID's to use for the items representing bookmarks in the
83 // bookmark menu, must not overlap with that for recent tabs submenu.
84 static const int kMinBookmarkCommandId = 1;
85 static const int kMaxBookmarkCommandId = 1000;
86
87 // Range of command ID's to use for the items in the recent tabs submenu, must
88 // not overlap with that for bookmarks.
89 static const int kMinRecentTabsCommandId = 1001;
90 static const int kMaxRecentTabsCommandId = 1200;
91
82 // TODO: remove |is_new_menu|. 92 // TODO: remove |is_new_menu|.
83 WrenchMenuModel(ui::AcceleratorProvider* provider, 93 WrenchMenuModel(ui::AcceleratorProvider* provider,
84 Browser* browser, 94 Browser* browser,
85 bool is_new_menu); 95 bool is_new_menu);
86 virtual ~WrenchMenuModel(); 96 virtual ~WrenchMenuModel();
87 97
88 // Overridden for ButtonMenuItemModel::Delegate: 98 // Overridden for ButtonMenuItemModel::Delegate:
89 virtual bool DoesCommandIdDismissMenu(int command_id) const OVERRIDE; 99 virtual bool DoesCommandIdDismissMenu(int command_id) const OVERRIDE;
90 100
91 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: 101 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel:
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 Browser* browser_; // weak 183 Browser* browser_; // weak
174 TabStripModel* tab_strip_model_; // weak 184 TabStripModel* tab_strip_model_; // weak
175 185
176 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; 186 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
177 content::NotificationRegistrar registrar_; 187 content::NotificationRegistrar registrar_;
178 188
179 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); 189 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel);
180 }; 190 };
181 191
182 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ 192 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698