OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYSTEM_IMPL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
7 | 7 |
8 #include "extensions/browser/extension_system.h" | 8 #include "extensions/browser/extension_system.h" |
9 #include "extensions/common/one_shot_event.h" | 9 #include "extensions/common/one_shot_event.h" |
10 | 10 |
11 class Profile; | 11 class Profile; |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
| 15 class ContentVerifier; |
15 class ExtensionSystemSharedFactory; | 16 class ExtensionSystemSharedFactory; |
16 class ExtensionWarningBadgeService; | 17 class ExtensionWarningBadgeService; |
17 class NavigationObserver; | 18 class NavigationObserver; |
18 class StandardManagementPolicyProvider; | 19 class StandardManagementPolicyProvider; |
19 | 20 |
20 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. | 21 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. |
21 // Implementation details: non-shared services are owned by | 22 // Implementation details: non-shared services are owned by |
22 // ExtensionSystemImpl, a KeyedService with separate incognito | 23 // ExtensionSystemImpl, a KeyedService with separate incognito |
23 // instances. A private Shared class (also a KeyedService, | 24 // instances. A private Shared class (also a KeyedService, |
24 // but with a shared instance for incognito) keeps the common services. | 25 // but with a shared instance for incognito) keeps the common services. |
(...skipping 25 matching lines...) Expand all Loading... |
50 virtual QuotaService* quota_service() OVERRIDE; // shared | 51 virtual QuotaService* quota_service() OVERRIDE; // shared |
51 | 52 |
52 virtual void RegisterExtensionWithRequestContexts( | 53 virtual void RegisterExtensionWithRequestContexts( |
53 const Extension* extension) OVERRIDE; | 54 const Extension* extension) OVERRIDE; |
54 | 55 |
55 virtual void UnregisterExtensionWithRequestContexts( | 56 virtual void UnregisterExtensionWithRequestContexts( |
56 const std::string& extension_id, | 57 const std::string& extension_id, |
57 const UnloadedExtensionInfo::Reason reason) OVERRIDE; | 58 const UnloadedExtensionInfo::Reason reason) OVERRIDE; |
58 | 59 |
59 virtual const OneShotEvent& ready() const OVERRIDE; | 60 virtual const OneShotEvent& ready() const OVERRIDE; |
| 61 virtual ContentVerifier* content_verifier() OVERRIDE; // shared |
60 | 62 |
61 private: | 63 private: |
62 friend class ExtensionSystemSharedFactory; | 64 friend class ExtensionSystemSharedFactory; |
63 | 65 |
64 // Owns the Extension-related systems that have a single instance | 66 // Owns the Extension-related systems that have a single instance |
65 // shared between normal and incognito profiles. | 67 // shared between normal and incognito profiles. |
66 class Shared : public KeyedService { | 68 class Shared : public KeyedService { |
67 public: | 69 public: |
68 explicit Shared(Profile* profile); | 70 explicit Shared(Profile* profile); |
69 virtual ~Shared(); | 71 virtual ~Shared(); |
(...skipping 15 matching lines...) Expand all Loading... |
85 UserScriptMaster* user_script_master(); | 87 UserScriptMaster* user_script_master(); |
86 Blacklist* blacklist(); | 88 Blacklist* blacklist(); |
87 InfoMap* info_map(); | 89 InfoMap* info_map(); |
88 LazyBackgroundTaskQueue* lazy_background_task_queue(); | 90 LazyBackgroundTaskQueue* lazy_background_task_queue(); |
89 EventRouter* event_router(); | 91 EventRouter* event_router(); |
90 ExtensionWarningService* warning_service(); | 92 ExtensionWarningService* warning_service(); |
91 ErrorConsole* error_console(); | 93 ErrorConsole* error_console(); |
92 InstallVerifier* install_verifier(); | 94 InstallVerifier* install_verifier(); |
93 QuotaService* quota_service(); | 95 QuotaService* quota_service(); |
94 const OneShotEvent& ready() const { return ready_; } | 96 const OneShotEvent& ready() const { return ready_; } |
| 97 ContentVerifier* content_verifier(); |
95 | 98 |
96 private: | 99 private: |
97 Profile* profile_; | 100 Profile* profile_; |
98 | 101 |
99 // The services that are shared between normal and incognito profiles. | 102 // The services that are shared between normal and incognito profiles. |
100 | 103 |
101 scoped_ptr<StateStore> state_store_; | 104 scoped_ptr<StateStore> state_store_; |
102 scoped_ptr<StateStore> rules_store_; | 105 scoped_ptr<StateStore> rules_store_; |
103 // LazyBackgroundTaskQueue is a dependency of | 106 // LazyBackgroundTaskQueue is a dependency of |
104 // MessageService and EventRouter. | 107 // MessageService and EventRouter. |
(...skipping 10 matching lines...) Expand all Loading... |
115 scoped_ptr<ExtensionService> extension_service_; | 118 scoped_ptr<ExtensionService> extension_service_; |
116 scoped_ptr<ManagementPolicy> management_policy_; | 119 scoped_ptr<ManagementPolicy> management_policy_; |
117 // extension_info_map_ needs to outlive process_manager_. | 120 // extension_info_map_ needs to outlive process_manager_. |
118 scoped_refptr<InfoMap> extension_info_map_; | 121 scoped_refptr<InfoMap> extension_info_map_; |
119 scoped_ptr<ExtensionWarningService> extension_warning_service_; | 122 scoped_ptr<ExtensionWarningService> extension_warning_service_; |
120 scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_; | 123 scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_; |
121 scoped_ptr<ErrorConsole> error_console_; | 124 scoped_ptr<ErrorConsole> error_console_; |
122 scoped_ptr<InstallVerifier> install_verifier_; | 125 scoped_ptr<InstallVerifier> install_verifier_; |
123 scoped_ptr<QuotaService> quota_service_; | 126 scoped_ptr<QuotaService> quota_service_; |
124 | 127 |
| 128 // For verifying the contents of extensions read from disk. |
| 129 scoped_refptr<ContentVerifier> content_verifier_; |
| 130 |
125 #if defined(OS_CHROMEOS) | 131 #if defined(OS_CHROMEOS) |
126 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> | 132 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> |
127 device_local_account_management_policy_provider_; | 133 device_local_account_management_policy_provider_; |
128 #endif | 134 #endif |
129 | 135 |
130 OneShotEvent ready_; | 136 OneShotEvent ready_; |
131 }; | 137 }; |
132 | 138 |
133 Profile* profile_; | 139 Profile* profile_; |
134 | 140 |
135 Shared* shared_; | 141 Shared* shared_; |
136 | 142 |
137 // |process_manager_| must be destroyed before the Profile's |io_data_|. While | 143 // |process_manager_| must be destroyed before the Profile's |io_data_|. While |
138 // |process_manager_| still lives, we handle incoming resource requests from | 144 // |process_manager_| still lives, we handle incoming resource requests from |
139 // extension processes and those require access to the ResourceContext owned | 145 // extension processes and those require access to the ResourceContext owned |
140 // by |io_data_|. | 146 // by |io_data_|. |
141 scoped_ptr<ProcessManager> process_manager_; | 147 scoped_ptr<ProcessManager> process_manager_; |
142 | 148 |
143 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 149 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
144 }; | 150 }; |
145 | 151 |
146 } // namespace extensions | 152 } // namespace extensions |
147 | 153 |
148 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
OLD | NEW |