OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ |
7 | 7 |
8 #include "chrome/browser/ui/extensions/extension_action_view_controller.h" | 8 #include "chrome/browser/ui/extensions/extension_action_view_controller.h" |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 class ExtensionViewHost; | 13 class ExtensionViewHost; |
14 } | 14 } |
15 | 15 |
16 class ExtensionActionPlatformDelegate { | 16 class ExtensionActionPlatformDelegate { |
17 public: | 17 public: |
18 virtual ~ExtensionActionPlatformDelegate() {} | 18 virtual ~ExtensionActionPlatformDelegate() {} |
19 | 19 |
20 // Returns a created ExtensionActionPlatformDelegate. This is defined in the | 20 // Returns a created ExtensionActionPlatformDelegate. This is defined in the |
21 // platform-specific implementation for the class. | 21 // platform-specific implementation for the class. |
22 static scoped_ptr<ExtensionActionPlatformDelegate> Create( | 22 static std::unique_ptr<ExtensionActionPlatformDelegate> Create( |
23 ExtensionActionViewController* controller); | 23 ExtensionActionViewController* controller); |
24 | 24 |
25 // The following are forwarded from ToolbarActionViewController. See that | 25 // The following are forwarded from ToolbarActionViewController. See that |
26 // class for the definitions. | 26 // class for the definitions. |
27 virtual void RegisterCommand() = 0; | 27 virtual void RegisterCommand() = 0; |
28 | 28 |
29 // Called once the delegate is set, in order to do any extra initialization. | 29 // Called once the delegate is set, in order to do any extra initialization. |
30 virtual void OnDelegateSet() {} | 30 virtual void OnDelegateSet() {} |
31 | 31 |
32 // Shows the given |host|. |grant_tab_permissions| is true if active tab | 32 // Shows the given |host|. |grant_tab_permissions| is true if active tab |
33 // permissions should be given to the extension; this is only true if the | 33 // permissions should be given to the extension; this is only true if the |
34 // popup is opened through a user action. | 34 // popup is opened through a user action. |
35 virtual void ShowPopup( | 35 virtual void ShowPopup( |
36 scoped_ptr<extensions::ExtensionViewHost> host, | 36 std::unique_ptr<extensions::ExtensionViewHost> host, |
37 bool grant_tab_permissions, | 37 bool grant_tab_permissions, |
38 ExtensionActionViewController::PopupShowAction show_action) = 0; | 38 ExtensionActionViewController::PopupShowAction show_action) = 0; |
39 | 39 |
40 // Closes the overflow menu, if it was open. | 40 // Closes the overflow menu, if it was open. |
41 virtual void CloseOverflowMenu() = 0; | 41 virtual void CloseOverflowMenu() = 0; |
42 | 42 |
43 // Shows the context menu for the extension. | 43 // Shows the context menu for the extension. |
44 virtual void ShowContextMenu() = 0; | 44 virtual void ShowContextMenu() = 0; |
45 }; | 45 }; |
46 | 46 |
47 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ | 47 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_ |
OLD | NEW |