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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_action_view_delegate.h

Issue 869873008: [Extensions Toolbar] Move some popup logic to be platform-agnostic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avi's Created 5 years, 10 months 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
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_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_
7 7
8 class ToolbarActionViewController; 8 class ToolbarActionViewController;
9 9
10 namespace content { 10 namespace content {
11 class WebContents; 11 class WebContents;
12 } 12 }
13 13
14 // The view for a ToolbarAction, which is controlled by a 14 // The view for a ToolbarAction, which is controlled by a
15 // ToolbarActionViewController. 15 // ToolbarActionViewController.
16 class ToolbarActionViewDelegate { 16 class ToolbarActionViewDelegate {
17 public: 17 public:
18 // In some cases (such as when an action is shown in a menu), a substitute 18 // In some cases (such as when an action is shown in a menu), a substitute
19 // ToolbarActionViewController should be used for showing popups. This 19 // ToolbarActionViewController should be used for showing popups. This
20 // returns the preferred controller. 20 // returns the preferred controller.
21 virtual ToolbarActionViewController* GetPreferredPopupViewController() = 0; 21 virtual ToolbarActionViewController* GetPreferredPopupViewController() = 0;
22 22
23 // Returns the current web contents. 23 // Returns the current web contents.
24 virtual content::WebContents* GetCurrentWebContents() const = 0; 24 virtual content::WebContents* GetCurrentWebContents() const = 0;
25 25
26 // Updates the view to reflect current state. 26 // Updates the view to reflect current state.
27 virtual void UpdateState() = 0; 27 virtual void UpdateState() = 0;
28 28
29 // Called when a popup is shown. If |by_user| is true, then this was through
30 // a direct user action (as oppposed to, e.g., an API call).
31 virtual void OnPopupShown(bool by_user) {}
32
33 // Called when a popup is closed.
34 virtual void OnPopupClosed() {}
35
29 protected: 36 protected:
30 virtual ~ToolbarActionViewDelegate() {} 37 virtual ~ToolbarActionViewDelegate() {}
31 }; 38 };
32 39
33 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_ 40 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698