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

Side by Side Diff: chrome/browser/extensions/page_action_controller.h

Issue 496403003: Remove NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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_PAGE_ACTION_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
7 7
8 #include <string> 8 #include "base/macros.h"
9
10 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
11 #include "chrome/browser/extensions/location_bar_controller.h" 9 #include "chrome/browser/extensions/location_bar_controller.h"
12 10
13 class Profile; 11 namespace content {
12 class BrowserContext;
13 class WebContents;
14 }
14 15
15 namespace extensions { 16 namespace extensions {
16 class ExtensionRegistry; 17 class Extension;
17 18
18 // A LocationBarControllerProvider which populates the location bar with icons 19 // A LocationBarControllerProvider which populates the location bar with icons
19 // based on the page_action extension API. 20 // based on the page_action extension API.
20 // TODO(rdevlin.cronin): This isn't really a controller. 21 // TODO(rdevlin.cronin): This isn't really a controller.
21 class PageActionController : public LocationBarController::ActionProvider, 22 class PageActionController : public LocationBarController::ActionProvider {
22 public ExtensionActionAPI::Observer {
23 public: 23 public:
24 explicit PageActionController(content::WebContents* web_contents); 24 explicit PageActionController(content::WebContents* web_contents);
25 virtual ~PageActionController(); 25 virtual ~PageActionController();
26 26
27 // LocationBarController::Provider implementation. 27 // LocationBarController::Provider implementation.
28 virtual ExtensionAction* GetActionForExtension(const Extension* extension) 28 virtual ExtensionAction* GetActionForExtension(const Extension* extension)
29 OVERRIDE; 29 OVERRIDE;
30 virtual ExtensionAction::ShowAction OnClicked( 30 virtual ExtensionAction::ShowAction OnClicked(
31 const Extension* extension) OVERRIDE; 31 const Extension* extension) OVERRIDE;
32 virtual void OnNavigated() OVERRIDE; 32 virtual void OnNavigated() OVERRIDE;
33 33
34 private: 34 private:
35 // ExtensionActionAPI::Observer implementation.
36 virtual void OnExtensionActionUpdated(
37 ExtensionAction* extension_action,
38 content::WebContents* web_contents,
39 content::BrowserContext* browser_context) OVERRIDE;
40
41 // Returns the associated Profile.
42 Profile* GetProfile();
43
44 // The associated WebContents. 35 // The associated WebContents.
45 content::WebContents* web_contents_; 36 content::WebContents* web_contents_;
46 37
47 ScopedObserver<ExtensionActionAPI, ExtensionActionAPI::Observer> 38 // The associated browser context.
48 extension_action_observer_; 39 content::BrowserContext* browser_context_;
49 40
50 DISALLOW_COPY_AND_ASSIGN(PageActionController); 41 DISALLOW_COPY_AND_ASSIGN(PageActionController);
51 }; 42 };
52 43
53 } // namespace extensions 44 } // namespace extensions
54 45
55 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ 46 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698