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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
10 #include "chrome/browser/extensions/location_bar_controller.h"
14 namespace extensions
{
15 class ExtensionRegistry
;
17 // A LocationBarControllerProvider which populates the location bar with icons
18 // based on the page_action extension API.
19 // TODO(rdevlin.cronin): This isn't really a controller.
20 class PageActionController
: public LocationBarController::ActionProvider
{
22 explicit PageActionController(content::WebContents
* web_contents
);
23 virtual ~PageActionController();
25 // LocationBarController::Provider implementation.
26 virtual ExtensionAction
* GetActionForExtension(const Extension
* extension
)
28 virtual LocationBarController::Action
OnClicked(
29 const Extension
* extension
) OVERRIDE
;
30 virtual void OnNavigated() OVERRIDE
;
33 // Returns the associated Profile.
34 Profile
* GetProfile();
36 // The associated WebContents.
37 content::WebContents
* web_contents_
;
39 DISALLOW_COPY_AND_ASSIGN(PageActionController
);
42 } // namespace extensions
44 #endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_