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