• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
7 
8 #include <string>
9 
10 #include "chrome/browser/extensions/location_bar_controller.h"
11 
12 class Profile;
13 
14 namespace extensions {
15 class ExtensionRegistry;
16 
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 {
21  public:
22   explicit PageActionController(content::WebContents* web_contents);
23   virtual ~PageActionController();
24 
25   // LocationBarController::Provider implementation.
26   virtual ExtensionAction* GetActionForExtension(const Extension* extension)
27       OVERRIDE;
28   virtual LocationBarController::Action OnClicked(
29       const Extension* extension) OVERRIDE;
30   virtual void OnNavigated() OVERRIDE;
31 
32  private:
33   // Returns the associated Profile.
34   Profile* GetProfile();
35 
36   // The associated WebContents.
37   content::WebContents* web_contents_;
38 
39   DISALLOW_COPY_AND_ASSIGN(PageActionController);
40 };
41 
42 }  // namespace extensions
43 
44 #endif  // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
45