| OLD | NEW | 
|---|
| 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 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include <set> | 9 #include <set> | 
| 10 #include <string> | 10 #include <string> | 
| 11 | 11 | 
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" | 
| 13 #include "chrome/browser/extensions/location_bar_controller.h" | 13 #include "chrome/browser/extensions/location_bar_controller.h" | 
| 14 | 14 | 
| 15 class ExtensionService; | 15 class ExtensionService; | 
| 16 class TabContents; | 16 class TabContents; | 
| 17 | 17 | 
| 18 namespace extensions { | 18 namespace extensions { | 
| 19 | 19 | 
| 20 // A LocationBarController which populates the location bar with icons based | 20 // A LocationBarController which populates the location bar with icons based | 
| 21 // on the page_action extension API. | 21 // on the page_action extension API. | 
| 22 class PageActionController : public LocationBarController { | 22 class PageActionController : public LocationBarController { | 
| 23  public: | 23  public: | 
| 24   explicit PageActionController(TabContents* tab_contents); | 24   explicit PageActionController(TabContents* tab_contents); | 
| 25   virtual ~PageActionController(); | 25   virtual ~PageActionController(); | 
| 26 | 26 | 
| 27   // LocationBarController implementation. | 27   // LocationBarController implementation. | 
| 28   virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions() | 28   virtual std::vector<ExtensionAction*> GetCurrentActions() OVERRIDE; | 
| 29       OVERRIDE; |  | 
| 30   virtual Action OnClicked(const std::string& extension_id, | 29   virtual Action OnClicked(const std::string& extension_id, | 
| 31                            int mouse_button) OVERRIDE; | 30                            int mouse_button) OVERRIDE; | 
| 32 | 31 | 
| 33  private: | 32  private: | 
| 34   // Gets the ExtensionService for |tab_contents_|. | 33   // Gets the ExtensionService for |tab_contents_|. | 
| 35   ExtensionService* GetExtensionService(); | 34   ExtensionService* GetExtensionService(); | 
| 36 | 35 | 
| 37   TabContents* tab_contents_; | 36   TabContents* tab_contents_; | 
| 38 | 37 | 
| 39   DISALLOW_COPY_AND_ASSIGN(PageActionController); | 38   DISALLOW_COPY_AND_ASSIGN(PageActionController); | 
| 40 }; | 39 }; | 
| 41 | 40 | 
| 42 }  // namespace extensions | 41 }  // namespace extensions | 
| 43 | 42 | 
| 44 #endif  // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ | 43 #endif  // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_ | 
| OLD | NEW | 
|---|