| OLD | NEW |
| 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 Loading... |
| 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 IDs to use for the items in the recent tabs submenu. |
| 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 Loading... |
| 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_ |
| OLD | NEW |