| 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_LOCATION_BAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 explicit LocationBarController(content::WebContents* web_contents); | 32 explicit LocationBarController(content::WebContents* web_contents); |
| 33 virtual ~LocationBarController(); | 33 virtual ~LocationBarController(); |
| 34 | 34 |
| 35 // Returns the actions which should be displayed in the location bar. | 35 // Returns the actions which should be displayed in the location bar. |
| 36 std::vector<ExtensionAction*> GetCurrentActions(); | 36 std::vector<ExtensionAction*> GetCurrentActions(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // ExtensionRegistryObserver implementation. | 39 // ExtensionRegistryObserver implementation. |
| 40 virtual void OnExtensionLoaded( | 40 virtual void OnExtensionLoaded( |
| 41 content::BrowserContext* browser_context, | 41 content::BrowserContext* browser_context, |
| 42 const Extension* extension) OVERRIDE; | 42 const Extension* extension) override; |
| 43 virtual void OnExtensionUnloaded( | 43 virtual void OnExtensionUnloaded( |
| 44 content::BrowserContext* browser_context, | 44 content::BrowserContext* browser_context, |
| 45 const Extension* extension, | 45 const Extension* extension, |
| 46 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 46 UnloadedExtensionInfo::Reason reason) override; |
| 47 | 47 |
| 48 // The associated WebContents. | 48 // The associated WebContents. |
| 49 content::WebContents* web_contents_; | 49 content::WebContents* web_contents_; |
| 50 | 50 |
| 51 // The associated BrowserContext. | 51 // The associated BrowserContext. |
| 52 content::BrowserContext* browser_context_; | 52 content::BrowserContext* browser_context_; |
| 53 | 53 |
| 54 // The ExtensionActionManager to provide page actions. | 54 // The ExtensionActionManager to provide page actions. |
| 55 ExtensionActionManager* action_manager_; | 55 ExtensionActionManager* action_manager_; |
| 56 | 56 |
| 57 // Whether or not to show page actions in the location bar at all. (This is | 57 // Whether or not to show page actions in the location bar at all. (This is |
| 58 // false with the toolbar redesign enabled.) | 58 // false with the toolbar redesign enabled.) |
| 59 bool should_show_page_actions_; | 59 bool should_show_page_actions_; |
| 60 | 60 |
| 61 // Manufactured page actions that have been generated for extensions that want | 61 // Manufactured page actions that have been generated for extensions that want |
| 62 // to run a script, but were blocked. | 62 // to run a script, but were blocked. |
| 63 typedef std::map<std::string, linked_ptr<ExtensionAction> > | 63 typedef std::map<std::string, linked_ptr<ExtensionAction> > |
| 64 ExtensionActionMap; | 64 ExtensionActionMap; |
| 65 ExtensionActionMap active_script_actions_; | 65 ExtensionActionMap active_script_actions_; |
| 66 | 66 |
| 67 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 67 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 68 extension_registry_observer_; | 68 extension_registry_observer_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(LocationBarController); | 70 DISALLOW_COPY_AND_ASSIGN(LocationBarController); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace extensions | 73 } // namespace extensions |
| 74 | 74 |
| 75 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ | 75 #endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_ |
| OLD | NEW |