OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | |
6 #define EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "base/memory/scoped_ptr.h" | |
James Cook
2014/01/28 23:40:57
do you need this header?
Yoyo Zhou
2014/01/29 00:42:56
Nope.
| |
12 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" | |
13 #include "extensions/common/extension.h" | |
14 #include "extensions/common/one_shot_event.h" | |
James Cook
2014/01/28 23:40:57
I don't think you need this header, probably can f
Yoyo Zhou
2014/01/29 00:42:56
Done.
| |
15 | |
16 class ExtensionService; | |
17 class Profile; | |
James Cook
2014/01/28 23:40:57
don't think you need this
Yoyo Zhou
2014/01/29 00:42:56
Done.
| |
18 | |
19 #if defined(OS_CHROMEOS) | |
20 namespace chromeos { | |
21 class DeviceLocalAccountManagementPolicyProvider; | |
22 } | |
23 #endif // defined(OS_CHROMEOS) | |
24 | |
25 namespace content { | |
26 class BrowserContext; | |
27 } | |
28 | |
29 namespace extensions { | |
30 | |
31 class Blacklist; | |
32 class ErrorConsole; | |
33 class EventRouter; | |
34 class Extension; | |
35 class ExtensionSystemSharedFactory; | |
36 class ExtensionWarningBadgeService; | |
37 class ExtensionWarningService; | |
38 class InfoMap; | |
39 class InstallVerifier; | |
40 class LazyBackgroundTaskQueue; | |
41 class ManagementPolicy; | |
42 class NavigationObserver; | |
43 class ProcessManager; | |
44 class RuntimeData; | |
45 class StandardManagementPolicyProvider; | |
46 class StateStore; | |
47 class UserScriptMaster; | |
48 // This interface supports using TestExtensionSystem for TestingProfiles | |
James Cook
2014/01/28 23:40:57
comment nit: Blank line above. Also, it would be n
Yoyo Zhou
2014/01/29 00:42:56
Added a comment.
| |
49 // that don't want all of the extensions baggage in their tests. | |
50 class ExtensionSystem : public BrowserContextKeyedService { | |
51 public: | |
52 ExtensionSystem(); | |
53 virtual ~ExtensionSystem(); | |
54 | |
55 // Returns the instance for the given browser context, or NULL if none. | |
56 // A convenience wrapper around ExtensionSystemFactory::GetForBrowserContext. | |
57 static ExtensionSystem* Get(content::BrowserContext* context); | |
James Cook
2014/01/28 23:40:57
Hooray, one Get() method to rule them all!
| |
58 | |
59 // BrowserContextKeyedService implementation. | |
60 virtual void Shutdown() OVERRIDE {} | |
James Cook
2014/01/28 23:40:57
optional nit: Maybe just not override it, since th
Yoyo Zhou
2014/01/29 00:42:56
Done.
| |
61 | |
62 // Initializes extensions machinery. | |
63 // Component extensions are always enabled, external and user extensions are | |
64 // controlled by |extensions_enabled|. | |
65 virtual void InitForRegularProfile(bool extensions_enabled) = 0; | |
66 | |
67 // The ExtensionService is created at startup. | |
68 virtual ExtensionService* extension_service() = 0; | |
69 | |
70 // Per-extension data that can change during the life of the process but | |
71 // does not persist across restarts. Lives on UI thread. Created at startup. | |
72 virtual RuntimeData* runtime_data() = 0; | |
73 | |
74 // The class controlling whether users are permitted to perform certain | |
75 // actions on extensions (install, uninstall, disable, etc.). | |
76 // The ManagementPolicy is created at startup. | |
77 virtual ManagementPolicy* management_policy() = 0; | |
78 | |
79 // The UserScriptMaster is created at startup. | |
80 virtual UserScriptMaster* user_script_master() = 0; | |
81 | |
82 // The ProcessManager is created at startup. | |
83 virtual ProcessManager* process_manager() = 0; | |
84 | |
85 // The StateStore is created at startup. | |
86 virtual StateStore* state_store() = 0; | |
87 | |
88 // The rules store is created at startup. | |
89 virtual StateStore* rules_store() = 0; | |
90 | |
91 // Returns the IO-thread-accessible extension data. | |
92 virtual InfoMap* info_map() = 0; | |
93 | |
94 // The LazyBackgroundTaskQueue is created at startup. | |
95 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() = 0; | |
96 | |
97 // The EventRouter is created at startup. | |
98 virtual EventRouter* event_router() = 0; | |
99 | |
100 // The ExtensionWarningService is created at startup. | |
101 virtual ExtensionWarningService* warning_service() = 0; | |
102 | |
103 // The blacklist is created at startup. | |
104 virtual Blacklist* blacklist() = 0; | |
105 | |
106 // The ErrorConsole is created at startup. | |
107 virtual ErrorConsole* error_console() = 0; | |
108 | |
109 // The InstallVerifier is created at startup. | |
110 virtual InstallVerifier* install_verifier() = 0; | |
111 | |
112 // Called by the ExtensionService that lives in this system. Gives the | |
113 // info map a chance to react to the load event before the EXTENSION_LOADED | |
114 // notification has fired. The purpose for handling this event first is to | |
115 // avoid race conditions by making sure URLRequestContexts learn about new | |
116 // extensions before anything else needs them to know. | |
117 virtual void RegisterExtensionWithRequestContexts( | |
118 const Extension* extension) {} | |
119 | |
120 // Called by the ExtensionService that lives in this system. Lets the | |
121 // info map clean up its RequestContexts once all the listeners to the | |
122 // EXTENSION_UNLOADED notification have finished running. | |
123 virtual void UnregisterExtensionWithRequestContexts( | |
124 const std::string& extension_id, | |
125 const UnloadedExtensionInfo::Reason reason) {} | |
126 | |
127 // Signaled when the extension system has completed its startup tasks. | |
128 virtual const OneShotEvent& ready() const = 0; | |
129 }; | |
130 | |
131 } // namespace extensions | |
132 | |
133 #endif // EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | |
OLD | NEW |