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 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 | 15 |
16 class ExtensionAction; | 16 class ExtensionAction; |
17 class Profile; | 17 class Profile; |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 class Extension; | 21 class Extension; |
22 | 22 |
23 // Owns the ExtensionActions associated with each extension. These actions live | 23 // Owns the ExtensionActions associated with each extension. These actions live |
24 // while an extension is loaded and are destroyed on unload. | 24 // while an extension is loaded and are destroyed on unload. |
25 class ExtensionActionManager : public BrowserContextKeyedService, | 25 class ExtensionActionManager : public KeyedService, |
26 public content::NotificationObserver { | 26 public content::NotificationObserver { |
27 public: | 27 public: |
28 explicit ExtensionActionManager(Profile* profile); | 28 explicit ExtensionActionManager(Profile* profile); |
29 virtual ~ExtensionActionManager(); | 29 virtual ~ExtensionActionManager(); |
30 | 30 |
31 // Returns this profile's ExtensionActionManager. One instance is | 31 // Returns this profile's ExtensionActionManager. One instance is |
32 // shared between a profile and its incognito version. | 32 // shared between a profile and its incognito version. |
33 static ExtensionActionManager* Get(Profile* profile); | 33 static ExtensionActionManager* Get(Profile* profile); |
34 | 34 |
35 // Retrieves the page action, or browser action for |extension|. | 35 // Retrieves the page action, or browser action for |extension|. |
(...skipping 20 matching lines...) Expand all Loading... |
56 // action. | 56 // action. |
57 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; | 57 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; |
58 mutable ExtIdToActionMap page_actions_; | 58 mutable ExtIdToActionMap page_actions_; |
59 mutable ExtIdToActionMap browser_actions_; | 59 mutable ExtIdToActionMap browser_actions_; |
60 mutable ExtIdToActionMap system_indicators_; | 60 mutable ExtIdToActionMap system_indicators_; |
61 }; | 61 }; |
62 | 62 |
63 } // namespace extensions | 63 } // namespace extensions |
64 | 64 |
65 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 65 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
OLD | NEW |