| 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_EXTENSION_ACTION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // into account |extension|'s browser or page actions, if any, along with its | 52 // into account |extension|'s browser or page actions, if any, along with its |
| 53 // name and any declared icons. | 53 // name and any declared icons. |
| 54 scoped_ptr<ExtensionAction> GetBestFitAction( | 54 scoped_ptr<ExtensionAction> GetBestFitAction( |
| 55 const Extension& extension, ActionInfo::Type type) const; | 55 const Extension& extension, ActionInfo::Type type) const; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // Implement ExtensionRegistryObserver. | 58 // Implement ExtensionRegistryObserver. |
| 59 virtual void OnExtensionUnloaded(content::BrowserContext* browser_context, | 59 virtual void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 60 const Extension* extension, | 60 const Extension* extension, |
| 61 UnloadedExtensionInfo::Reason reason) | 61 UnloadedExtensionInfo::Reason reason) |
| 62 OVERRIDE; | 62 override; |
| 63 | 63 |
| 64 Profile* profile_; | 64 Profile* profile_; |
| 65 | 65 |
| 66 // Listen to extension unloaded notifications. | 66 // Listen to extension unloaded notifications. |
| 67 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 67 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 68 extension_registry_observer_; | 68 extension_registry_observer_; |
| 69 | 69 |
| 70 // Keyed by Extension ID. These maps are populated lazily when their | 70 // Keyed by Extension ID. These maps are populated lazily when their |
| 71 // ExtensionAction is first requested, and the entries are removed when the | 71 // ExtensionAction is first requested, and the entries are removed when the |
| 72 // extension is unloaded. Not every extension has a page action or browser | 72 // extension is unloaded. Not every extension has a page action or browser |
| 73 // action. | 73 // action. |
| 74 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; | 74 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; |
| 75 mutable ExtIdToActionMap page_actions_; | 75 mutable ExtIdToActionMap page_actions_; |
| 76 mutable ExtIdToActionMap browser_actions_; | 76 mutable ExtIdToActionMap browser_actions_; |
| 77 mutable ExtIdToActionMap system_indicators_; | 77 mutable ExtIdToActionMap system_indicators_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace extensions | 80 } // namespace extensions |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
| OLD | NEW |