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 13 matching lines...) Expand all Loading... |
24 // Owns the ExtensionActions associated with each extension. These actions live | 24 // Owns the ExtensionActions associated with each extension. These actions live |
25 // while an extension is loaded and are destroyed on unload. | 25 // while an extension is loaded and are destroyed on unload. |
26 class ExtensionActionManager : public KeyedService, | 26 class ExtensionActionManager : public KeyedService, |
27 public ExtensionRegistryObserver { | 27 public ExtensionRegistryObserver { |
28 public: | 28 public: |
29 explicit ExtensionActionManager(Profile* profile); | 29 explicit ExtensionActionManager(Profile* profile); |
30 virtual ~ExtensionActionManager(); | 30 virtual ~ExtensionActionManager(); |
31 | 31 |
32 // Returns this profile's ExtensionActionManager. One instance is | 32 // Returns this profile's ExtensionActionManager. One instance is |
33 // shared between a profile and its incognito version. | 33 // shared between a profile and its incognito version. |
34 static ExtensionActionManager* Get(Profile* profile); | 34 static ExtensionActionManager* Get(content::BrowserContext* browser_context); |
35 | 35 |
36 // Retrieves the page action, or browser action for |extension|. | 36 // Retrieves the page action, or browser action for |extension|. |
37 // If the result is not NULL, it remains valid until the extension is | 37 // If the result is not NULL, it remains valid until the extension is |
38 // unloaded. | 38 // unloaded. |
39 ExtensionAction* GetPageAction(const extensions::Extension& extension) const; | 39 ExtensionAction* GetPageAction(const extensions::Extension& extension) const; |
40 ExtensionAction* GetBrowserAction( | 40 ExtensionAction* GetBrowserAction( |
41 const extensions::Extension& extension) const; | 41 const extensions::Extension& extension) const; |
42 ExtensionAction* GetSystemIndicator( | 42 ExtensionAction* GetSystemIndicator( |
43 const extensions::Extension& extension) const; | 43 const extensions::Extension& extension) const; |
44 | 44 |
(...skipping 23 matching lines...) Expand all Loading... |
68 // action. | 68 // action. |
69 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; | 69 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; |
70 mutable ExtIdToActionMap page_actions_; | 70 mutable ExtIdToActionMap page_actions_; |
71 mutable ExtIdToActionMap browser_actions_; | 71 mutable ExtIdToActionMap browser_actions_; |
72 mutable ExtIdToActionMap system_indicators_; | 72 mutable ExtIdToActionMap system_indicators_; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace extensions | 75 } // namespace extensions |
76 | 76 |
77 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 77 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
OLD | NEW |