| 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 "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 Loading... |
| 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 | |
| 92 // TODO: remove |is_new_menu|. | 82 // TODO: remove |is_new_menu|. |
| 93 WrenchMenuModel(ui::AcceleratorProvider* provider, | 83 WrenchMenuModel(ui::AcceleratorProvider* provider, |
| 94 Browser* browser, | 84 Browser* browser, |
| 95 bool is_new_menu); | 85 bool is_new_menu); |
| 96 virtual ~WrenchMenuModel(); | 86 virtual ~WrenchMenuModel(); |
| 97 | 87 |
| 98 // Overridden for ButtonMenuItemModel::Delegate: | 88 // Overridden for ButtonMenuItemModel::Delegate: |
| 99 virtual bool DoesCommandIdDismissMenu(int command_id) const OVERRIDE; | 89 virtual bool DoesCommandIdDismissMenu(int command_id) const OVERRIDE; |
| 100 | 90 |
| 101 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: | 91 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 Browser* browser_; // weak | 173 Browser* browser_; // weak |
| 184 TabStripModel* tab_strip_model_; // weak | 174 TabStripModel* tab_strip_model_; // weak |
| 185 | 175 |
| 186 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 176 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 187 content::NotificationRegistrar registrar_; | 177 content::NotificationRegistrar registrar_; |
| 188 | 178 |
| 189 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); | 179 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); |
| 190 }; | 180 }; |
| 191 | 181 |
| 192 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ | 182 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
| OLD | NEW |