OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ |
6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ |
7 | 7 |
8 #include "views/controls/menu/menu_2.h" | 8 #include "views/controls/menu/menu_2.h" |
9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
10 #include "chrome/browser/extensions/extension_action_context_menu_model.h" | 10 #include "chrome/browser/extensions/extension_action_context_menu_model.h" |
11 | 11 |
12 class Extension; | 12 class Extension; |
| 13 class ExtensionAction; |
| 14 class PrefService; |
13 | 15 |
14 // Displays the context menu for extension action icons (browser/page actions). | 16 // Displays the context menu for extension action icons (browser/page actions). |
15 class ExtensionActionContextMenu { | 17 class ExtensionActionContextMenu { |
16 public: | 18 public: |
17 ExtensionActionContextMenu(); | 19 ExtensionActionContextMenu(); |
18 ~ExtensionActionContextMenu(); | 20 ~ExtensionActionContextMenu(); |
19 | 21 |
20 // Display the context menu at a given point. | 22 // Display the context menu at a given point. |
21 void Run(Extension* extension, const gfx::Point& point); | 23 void Run(Extension* extension, |
| 24 ExtensionAction* extension_action, |
| 25 ExtensionActionContextMenuModel::MenuDelegate* delegate, |
| 26 PrefService* prefs, |
| 27 const gfx::Point& point); |
22 | 28 |
23 // Closes the context menu if open. | 29 // Closes the context menu if open. |
24 void Cancel(); | 30 void Cancel(); |
25 | 31 |
26 private: | 32 private: |
27 // The options menu. | 33 // The options menu. |
28 scoped_ptr<ExtensionActionContextMenuModel> context_menu_contents_; | 34 scoped_ptr<ExtensionActionContextMenuModel> context_menu_contents_; |
29 scoped_ptr<views::Menu2> context_menu_menu_; | 35 scoped_ptr<views::Menu2> context_menu_menu_; |
30 | 36 |
31 // The extension we are showing the menu for. | 37 // The extension we are showing the menu for. |
32 Extension* extension_; | 38 Extension* extension_; |
33 | 39 |
34 DISALLOW_COPY_AND_ASSIGN(ExtensionActionContextMenu); | 40 DISALLOW_COPY_AND_ASSIGN(ExtensionActionContextMenu); |
35 }; | 41 }; |
36 | 42 |
37 #endif // CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ | 43 #endif // CHROME_BROWSER_VIEWS_EXTENSIONS_EXTENSION_ACTION_CONTEXT_MENU_H_ |
OLD | NEW |