| 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 22 matching lines...) Expand all Loading... |
| 33 UNINSTALL, | 33 UNINSTALL, |
| 34 MANAGE, | 34 MANAGE, |
| 35 INSPECT_POPUP | 35 INSPECT_POPUP |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Delegate to handle showing an ExtensionAction popup. | 38 // Delegate to handle showing an ExtensionAction popup. |
| 39 class PopupDelegate { | 39 class PopupDelegate { |
| 40 public: | 40 public: |
| 41 // Called when the user selects the menu item which requests that the | 41 // Called when the user selects the menu item which requests that the |
| 42 // popup be shown and inspected. | 42 // popup be shown and inspected. |
| 43 virtual void InspectPopup(ExtensionAction* action) = 0; | 43 // The delegate should know which popup to display. |
| 44 virtual void InspectPopup() = 0; |
| 44 | 45 |
| 45 protected: | 46 protected: |
| 46 virtual ~PopupDelegate() {} | 47 virtual ~PopupDelegate() {} |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 // Creates a menu model for the given extension. If | 50 // Creates a menu model for the given extension. If |
| 50 // prefs::kExtensionsUIDeveloperMode is enabled then a menu item | 51 // prefs::kExtensionsUIDeveloperMode is enabled then a menu item |
| 51 // will be shown for "Inspect Popup" which, when selected, will cause | 52 // will be shown for "Inspect Popup" which, when selected, will cause |
| 52 // ShowPopupForDevToolsWindow() to be called on |delegate|. | 53 // ShowPopupForDevToolsWindow() to be called on |delegate|. |
| 53 ExtensionContextMenuModel(const extensions::Extension* extension, | 54 ExtensionContextMenuModel(const extensions::Extension* extension, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // The delegate which handles the 'inspect popup' menu command (or NULL). | 96 // The delegate which handles the 'inspect popup' menu command (or NULL). |
| 96 PopupDelegate* delegate_; | 97 PopupDelegate* delegate_; |
| 97 | 98 |
| 98 // Keeps track of the extension uninstall dialog. | 99 // Keeps track of the extension uninstall dialog. |
| 99 scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_; | 100 scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); | 102 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ | 105 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ |
| OLD | NEW |