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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_
8 #include "chrome/browser/ui/extensions/extension_action_view_controller.h"
12 namespace extensions
{
13 class ExtensionViewHost
;
16 class ExtensionActionPlatformDelegate
{
18 virtual ~ExtensionActionPlatformDelegate() {}
20 // Returns a created ExtensionActionPlatformDelegate. This is defined in the
21 // platform-specific implementation for the class.
22 static scoped_ptr
<ExtensionActionPlatformDelegate
> Create(
23 ExtensionActionViewController
* controller
);
25 // The following are forwarded from ToolbarActionViewController. See that
26 // class for the definitions.
27 virtual void RegisterCommand() = 0;
29 // Called once the delegate is set, in order to do any extra initialization.
30 virtual void OnDelegateSet() {}
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
34 // popup is opened through a user action.
35 virtual void ShowPopup(
36 scoped_ptr
<extensions::ExtensionViewHost
> host
,
37 bool grant_tab_permissions
,
38 ExtensionActionViewController::PopupShowAction show_action
) = 0;
40 // Closes the overflow menu, if it was open.
41 virtual void CloseOverflowMenu() = 0;
44 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_