Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/browser/ui/extensions/extension_action_platform_delegate.h

Issue 670463004: Make a platform-independent ToolbarActionViewController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_
7
8 #include "chrome/browser/ui/extensions/extension_action_view_controller.h"
9
10 class GURL;
11
12 class ExtensionActionPlatformDelegate {
13 public:
14 virtual ~ExtensionActionPlatformDelegate() {}
15
16 // Returns a created ExtensionActionPlatformDelegate. This is defined in the
17 // platform-specific implementation for the class.
18 static scoped_ptr<ExtensionActionPlatformDelegate> Create(
19 ExtensionActionViewController* controller);
20
21 // The following are forwarded from ToolbarActionViewController. See that
22 // class for the definitions.
23 virtual gfx::NativeView GetPopupNativeView() = 0;
24 virtual bool IsMenuRunning() const = 0;
25 virtual void RegisterCommand() = 0;
26
27 // Called once the delegate is set, in order to do any extra initialization.
28 virtual void OnDelegateSet() = 0;
29
30 // Returns true if there is currently a popup for this extension action.
31 virtual bool IsShowingPopup() const = 0;
32
33 // Closes the active popup (whether it was this action's popup or not).
34 virtual void CloseActivePopup() = 0;
35
36 // Closes this action's popup. This will only be called if the popup is
37 // showing.
38 virtual void CloseOwnPopup() = 0;
39
40 // Shows the popup for the extension action, given the associated |popup_url|.
41 // |grant_tab_permissions| is true if active tab permissions should be given
42 // to the extension; this is only true if the popup is opened through a user
43 // action.
44 // Returns true if a popup is successfully shown.
45 virtual bool ShowPopupWithUrl(
46 ExtensionActionViewController::PopupShowAction show_action,
47 const GURL& popup_url,
48 bool grant_tab_permissions) = 0;
49 };
50
51 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_PLATFORM_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698