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_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ExtensionContextMenuModel(const extensions::Extension* extension, | 64 ExtensionContextMenuModel(const extensions::Extension* extension, |
65 Browser* browser, | 65 Browser* browser, |
66 PopupDelegate* delegate); | 66 PopupDelegate* delegate); |
67 | 67 |
68 // Create a menu model for the given extension, without support | 68 // Create a menu model for the given extension, without support |
69 // for the "Inspect Popup" command. | 69 // for the "Inspect Popup" command. |
70 ExtensionContextMenuModel(const extensions::Extension* extension, | 70 ExtensionContextMenuModel(const extensions::Extension* extension, |
71 Browser* browser); | 71 Browser* browser); |
72 | 72 |
73 // SimpleMenuModel::Delegate overrides. | 73 // SimpleMenuModel::Delegate overrides. |
74 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 74 virtual bool IsCommandIdChecked(int command_id) const override; |
75 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 75 virtual bool IsCommandIdEnabled(int command_id) const override; |
76 virtual bool GetAcceleratorForCommandId( | 76 virtual bool GetAcceleratorForCommandId( |
77 int command_id, | 77 int command_id, |
78 ui::Accelerator* accelerator) OVERRIDE; | 78 ui::Accelerator* accelerator) override; |
79 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 79 virtual void ExecuteCommand(int command_id, int event_flags) override; |
80 | 80 |
81 // ExtensionUninstallDialog::Delegate: | 81 // ExtensionUninstallDialog::Delegate: |
82 virtual void ExtensionUninstallAccepted() OVERRIDE; | 82 virtual void ExtensionUninstallAccepted() override; |
83 virtual void ExtensionUninstallCanceled() OVERRIDE; | 83 virtual void ExtensionUninstallCanceled() override; |
84 | 84 |
85 private: | 85 private: |
86 friend class base::RefCounted<ExtensionContextMenuModel>; | 86 friend class base::RefCounted<ExtensionContextMenuModel>; |
87 friend class extensions::ExtensionContextMenuModelTest; | 87 friend class extensions::ExtensionContextMenuModelTest; |
88 | 88 |
89 virtual ~ExtensionContextMenuModel(); | 89 virtual ~ExtensionContextMenuModel(); |
90 | 90 |
91 void InitMenu(const extensions::Extension* extension); | 91 void InitMenu(const extensions::Extension* extension); |
92 | 92 |
93 // Gets the extension we are displaying the menu for. Returns NULL if the | 93 // Gets the extension we are displaying the menu for. Returns NULL if the |
(...skipping 29 matching lines...) Expand all Loading... |
123 // Menu matcher for context menu items specified by the extension. | 123 // Menu matcher for context menu items specified by the extension. |
124 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; | 124 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; |
125 | 125 |
126 // Number of extension items in this menu. Used for testing. | 126 // Number of extension items in this menu. Used for testing. |
127 int extension_items_count_; | 127 int extension_items_count_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); | 129 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); |
130 }; | 130 }; |
131 | 131 |
132 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 132 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
OLD | NEW |