| 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 "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "extensions/browser/extension_system.h" | 9 #include "extensions/browser/extension_system.h" |
| 10 #include "extensions/common/one_shot_event.h" | 10 #include "extensions/common/one_shot_event.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class ContentVerifier; | 16 class ContentVerifier; |
| 17 class DeclarativeUserScriptMaster; | 17 class DeclarativeUserScriptMaster; |
| 18 class ExtensionSystemSharedFactory; | 18 class ExtensionSystemSharedFactory; |
| 19 class ExtensionWarningBadgeService; | |
| 20 class NavigationObserver; | 19 class NavigationObserver; |
| 21 class SharedUserScriptMaster; | 20 class SharedUserScriptMaster; |
| 22 class StateStoreNotificationObserver; | 21 class StateStoreNotificationObserver; |
| 23 | 22 |
| 24 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. | 23 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. |
| 25 // Implementation details: non-shared services are owned by | 24 // Implementation details: non-shared services are owned by |
| 26 // ExtensionSystemImpl, a KeyedService with separate incognito | 25 // ExtensionSystemImpl, a KeyedService with separate incognito |
| 27 // instances. A private Shared class (also a KeyedService, | 26 // instances. A private Shared class (also a KeyedService, |
| 28 // but with a shared instance for incognito) keeps the common services. | 27 // but with a shared instance for incognito) keeps the common services. |
| 29 class ExtensionSystemImpl : public ExtensionSystem { | 28 class ExtensionSystemImpl : public ExtensionSystem { |
| 30 public: | 29 public: |
| 31 explicit ExtensionSystemImpl(Profile* profile); | 30 explicit ExtensionSystemImpl(Profile* profile); |
| 32 ~ExtensionSystemImpl() override; | 31 ~ExtensionSystemImpl() override; |
| 33 | 32 |
| 34 // KeyedService implementation. | 33 // KeyedService implementation. |
| 35 void Shutdown() override; | 34 void Shutdown() override; |
| 36 | 35 |
| 37 void InitForRegularProfile(bool extensions_enabled) override; | 36 void InitForRegularProfile(bool extensions_enabled) override; |
| 38 | 37 |
| 39 ExtensionService* extension_service() override; // shared | 38 ExtensionService* extension_service() override; // shared |
| 40 RuntimeData* runtime_data() override; // shared | 39 RuntimeData* runtime_data() override; // shared |
| 41 ManagementPolicy* management_policy() override; // shared | 40 ManagementPolicy* management_policy() override; // shared |
| 42 // shared | 41 // shared |
| 43 SharedUserScriptMaster* shared_user_script_master() override; | 42 SharedUserScriptMaster* shared_user_script_master() override; |
| 44 StateStore* state_store() override; // shared | 43 StateStore* state_store() override; // shared |
| 45 StateStore* rules_store() override; // shared | 44 StateStore* rules_store() override; // shared |
| 46 LazyBackgroundTaskQueue* lazy_background_task_queue() override; // shared | 45 LazyBackgroundTaskQueue* lazy_background_task_queue() override; // shared |
| 47 InfoMap* info_map() override; // shared | 46 InfoMap* info_map() override; // shared |
| 48 EventRouter* event_router() override; // shared | 47 EventRouter* event_router() override; // shared |
| 49 WarningService* warning_service() override; | |
| 50 Blacklist* blacklist() override; // shared | 48 Blacklist* blacklist() override; // shared |
| 51 ErrorConsole* error_console() override; | 49 ErrorConsole* error_console() override; |
| 52 InstallVerifier* install_verifier() override; | 50 InstallVerifier* install_verifier() override; |
| 53 QuotaService* quota_service() override; // shared | 51 QuotaService* quota_service() override; // shared |
| 54 | 52 |
| 55 void RegisterExtensionWithRequestContexts( | 53 void RegisterExtensionWithRequestContexts( |
| 56 const Extension* extension) override; | 54 const Extension* extension) override; |
| 57 | 55 |
| 58 void UnregisterExtensionWithRequestContexts( | 56 void UnregisterExtensionWithRequestContexts( |
| 59 const std::string& extension_id, | 57 const std::string& extension_id, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 89 StateStore* state_store(); | 87 StateStore* state_store(); |
| 90 StateStore* rules_store(); | 88 StateStore* rules_store(); |
| 91 ExtensionService* extension_service(); | 89 ExtensionService* extension_service(); |
| 92 RuntimeData* runtime_data(); | 90 RuntimeData* runtime_data(); |
| 93 ManagementPolicy* management_policy(); | 91 ManagementPolicy* management_policy(); |
| 94 SharedUserScriptMaster* shared_user_script_master(); | 92 SharedUserScriptMaster* shared_user_script_master(); |
| 95 Blacklist* blacklist(); | 93 Blacklist* blacklist(); |
| 96 InfoMap* info_map(); | 94 InfoMap* info_map(); |
| 97 LazyBackgroundTaskQueue* lazy_background_task_queue(); | 95 LazyBackgroundTaskQueue* lazy_background_task_queue(); |
| 98 EventRouter* event_router(); | 96 EventRouter* event_router(); |
| 99 WarningService* warning_service(); | |
| 100 ErrorConsole* error_console(); | 97 ErrorConsole* error_console(); |
| 101 InstallVerifier* install_verifier(); | 98 InstallVerifier* install_verifier(); |
| 102 QuotaService* quota_service(); | 99 QuotaService* quota_service(); |
| 103 const OneShotEvent& ready() const { return ready_; } | 100 const OneShotEvent& ready() const { return ready_; } |
| 104 ContentVerifier* content_verifier(); | 101 ContentVerifier* content_verifier(); |
| 105 | 102 |
| 106 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( | 103 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( |
| 107 const ExtensionId& extension_id); | 104 const ExtensionId& extension_id); |
| 108 | 105 |
| 109 private: | 106 private: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 127 // per extension. Managers are instantiated the first time the declarative | 124 // per extension. Managers are instantiated the first time the declarative |
| 128 // API is used by an extension to request content scripts. | 125 // API is used by an extension to request content scripts. |
| 129 ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_; | 126 ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_; |
| 130 scoped_ptr<Blacklist> blacklist_; | 127 scoped_ptr<Blacklist> blacklist_; |
| 131 scoped_ptr<RuntimeData> runtime_data_; | 128 scoped_ptr<RuntimeData> runtime_data_; |
| 132 // ExtensionService depends on StateStore, Blacklist and RuntimeData. | 129 // ExtensionService depends on StateStore, Blacklist and RuntimeData. |
| 133 scoped_ptr<ExtensionService> extension_service_; | 130 scoped_ptr<ExtensionService> extension_service_; |
| 134 scoped_ptr<ManagementPolicy> management_policy_; | 131 scoped_ptr<ManagementPolicy> management_policy_; |
| 135 // extension_info_map_ needs to outlive process_manager_. | 132 // extension_info_map_ needs to outlive process_manager_. |
| 136 scoped_refptr<InfoMap> extension_info_map_; | 133 scoped_refptr<InfoMap> extension_info_map_; |
| 137 scoped_ptr<WarningService> warning_service_; | |
| 138 scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_; | |
| 139 scoped_ptr<ErrorConsole> error_console_; | 134 scoped_ptr<ErrorConsole> error_console_; |
| 140 scoped_ptr<InstallVerifier> install_verifier_; | 135 scoped_ptr<InstallVerifier> install_verifier_; |
| 141 scoped_ptr<QuotaService> quota_service_; | 136 scoped_ptr<QuotaService> quota_service_; |
| 142 | 137 |
| 143 // For verifying the contents of extensions read from disk. | 138 // For verifying the contents of extensions read from disk. |
| 144 scoped_refptr<ContentVerifier> content_verifier_; | 139 scoped_refptr<ContentVerifier> content_verifier_; |
| 145 | 140 |
| 146 #if defined(OS_CHROMEOS) | 141 #if defined(OS_CHROMEOS) |
| 147 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> | 142 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> |
| 148 device_local_account_management_policy_provider_; | 143 device_local_account_management_policy_provider_; |
| 149 #endif | 144 #endif |
| 150 | 145 |
| 151 OneShotEvent ready_; | 146 OneShotEvent ready_; |
| 152 }; | 147 }; |
| 153 | 148 |
| 154 Profile* profile_; | 149 Profile* profile_; |
| 155 | 150 |
| 156 Shared* shared_; | 151 Shared* shared_; |
| 157 | 152 |
| 158 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 153 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
| 159 }; | 154 }; |
| 160 | 155 |
| 161 } // namespace extensions | 156 } // namespace extensions |
| 162 | 157 |
| 163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 158 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
| OLD | NEW |