OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_MODEL_H_ |
| 7 |
| 8 #include "views/controls/menu/simple_menu_model.h" |
| 9 #include "chrome/browser/extensions/extension_install_ui.h" |
| 10 |
| 11 class Extension; |
| 12 |
| 13 // The menu model for the context menu for extension action icons (browser and |
| 14 // page actions). |
| 15 class ExtensionActionContextMenuModel |
| 16 : public views::SimpleMenuModel, |
| 17 public views::SimpleMenuModel::Delegate { |
| 18 public: |
| 19 ExtensionActionContextMenuModel(Extension* extension, |
| 20 ExtensionInstallUI::Delegate* delegate); |
| 21 ~ExtensionActionContextMenuModel(); |
| 22 |
| 23 // SimpleMenuModel behavior overrides. |
| 24 virtual bool IsCommandIdChecked(int command_id) const; |
| 25 virtual bool IsCommandIdEnabled(int command_id) const; |
| 26 virtual bool GetAcceleratorForCommandId(int command_id, |
| 27 views::Accelerator* accelerator); |
| 28 virtual void ExecuteCommand(int command_id); |
| 29 |
| 30 private: |
| 31 // The extension we are displaying the context menu for. |
| 32 Extension* extension_; |
| 33 |
| 34 // The delegate that handles the extension Uninstall operation. |
| 35 ExtensionInstallUI::Delegate* delegate_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ExtensionActionContextMenuModel); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_MODEL_H_ |
OLD | NEW |