| 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 ContentVerifier; |
| 16 class DeclarativeUserScriptMaster; |
| 16 class ExtensionSystemSharedFactory; | 17 class ExtensionSystemSharedFactory; |
| 17 class ExtensionWarningBadgeService; | 18 class ExtensionWarningBadgeService; |
| 18 class NavigationObserver; | 19 class NavigationObserver; |
| 19 class StandardManagementPolicyProvider; | 20 class StandardManagementPolicyProvider; |
| 21 class UserScriptMasterManager; |
| 20 | 22 |
| 21 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. | 23 // The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl. |
| 22 // Implementation details: non-shared services are owned by | 24 // Implementation details: non-shared services are owned by |
| 23 // ExtensionSystemImpl, a KeyedService with separate incognito | 25 // ExtensionSystemImpl, a KeyedService with separate incognito |
| 24 // instances. A private Shared class (also a KeyedService, | 26 // instances. A private Shared class (also a KeyedService, |
| 25 // but with a shared instance for incognito) keeps the common services. | 27 // but with a shared instance for incognito) keeps the common services. |
| 26 class ExtensionSystemImpl : public ExtensionSystem { | 28 class ExtensionSystemImpl : public ExtensionSystem { |
| 27 public: | 29 public: |
| 28 explicit ExtensionSystemImpl(Profile* profile); | 30 explicit ExtensionSystemImpl(Profile* profile); |
| 29 virtual ~ExtensionSystemImpl(); | 31 virtual ~ExtensionSystemImpl(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 | 57 |
| 56 virtual void UnregisterExtensionWithRequestContexts( | 58 virtual void UnregisterExtensionWithRequestContexts( |
| 57 const std::string& extension_id, | 59 const std::string& extension_id, |
| 58 const UnloadedExtensionInfo::Reason reason) OVERRIDE; | 60 const UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| 59 | 61 |
| 60 virtual const OneShotEvent& ready() const OVERRIDE; | 62 virtual const OneShotEvent& ready() const OVERRIDE; |
| 61 virtual ContentVerifier* content_verifier() OVERRIDE; // shared | 63 virtual ContentVerifier* content_verifier() OVERRIDE; // shared |
| 62 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( | 64 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( |
| 63 const Extension* extension) OVERRIDE; | 65 const Extension* extension) OVERRIDE; |
| 64 | 66 |
| 67 virtual DeclarativeUserScriptMaster* |
| 68 GetDeclarativeUserScriptMasterByExtension( |
| 69 const ExtensionId& extension_id) OVERRIDE; |
| 70 |
| 65 private: | 71 private: |
| 66 friend class ExtensionSystemSharedFactory; | 72 friend class ExtensionSystemSharedFactory; |
| 67 | 73 |
| 68 // Owns the Extension-related systems that have a single instance | 74 // Owns the Extension-related systems that have a single instance |
| 69 // shared between normal and incognito profiles. | 75 // shared between normal and incognito profiles. |
| 70 class Shared : public KeyedService { | 76 class Shared : public KeyedService { |
| 71 public: | 77 public: |
| 72 explicit Shared(Profile* profile); | 78 explicit Shared(Profile* profile); |
| 73 virtual ~Shared(); | 79 virtual ~Shared(); |
| 74 | 80 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 91 InfoMap* info_map(); | 97 InfoMap* info_map(); |
| 92 LazyBackgroundTaskQueue* lazy_background_task_queue(); | 98 LazyBackgroundTaskQueue* lazy_background_task_queue(); |
| 93 EventRouter* event_router(); | 99 EventRouter* event_router(); |
| 94 ExtensionWarningService* warning_service(); | 100 ExtensionWarningService* warning_service(); |
| 95 ErrorConsole* error_console(); | 101 ErrorConsole* error_console(); |
| 96 InstallVerifier* install_verifier(); | 102 InstallVerifier* install_verifier(); |
| 97 QuotaService* quota_service(); | 103 QuotaService* quota_service(); |
| 98 const OneShotEvent& ready() const { return ready_; } | 104 const OneShotEvent& ready() const { return ready_; } |
| 99 ContentVerifier* content_verifier(); | 105 ContentVerifier* content_verifier(); |
| 100 | 106 |
| 107 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( |
| 108 const ExtensionId& extension_id); |
| 109 |
| 101 private: | 110 private: |
| 102 Profile* profile_; | 111 Profile* profile_; |
| 103 | 112 |
| 104 // The services that are shared between normal and incognito profiles. | 113 // The services that are shared between normal and incognito profiles. |
| 105 | 114 |
| 106 scoped_ptr<StateStore> state_store_; | 115 scoped_ptr<StateStore> state_store_; |
| 107 scoped_ptr<StateStore> rules_store_; | 116 scoped_ptr<StateStore> rules_store_; |
| 108 // LazyBackgroundTaskQueue is a dependency of | 117 // LazyBackgroundTaskQueue is a dependency of |
| 109 // MessageService and EventRouter. | 118 // MessageService and EventRouter. |
| 110 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 119 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
| 111 scoped_ptr<EventRouter> event_router_; | 120 scoped_ptr<EventRouter> event_router_; |
| 112 scoped_ptr<NavigationObserver> navigation_observer_; | 121 scoped_ptr<NavigationObserver> navigation_observer_; |
| 113 scoped_ptr<UserScriptMaster> user_script_master_; | 122 scoped_ptr<UserScriptMasterManager> user_script_master_manager_; |
| 114 scoped_ptr<Blacklist> blacklist_; | 123 scoped_ptr<Blacklist> blacklist_; |
| 115 // StandardManagementPolicyProvider depends on Blacklist. | 124 // StandardManagementPolicyProvider depends on Blacklist. |
| 116 scoped_ptr<StandardManagementPolicyProvider> | 125 scoped_ptr<StandardManagementPolicyProvider> |
| 117 standard_management_policy_provider_; | 126 standard_management_policy_provider_; |
| 118 scoped_ptr<RuntimeData> runtime_data_; | 127 scoped_ptr<RuntimeData> runtime_data_; |
| 119 // ExtensionService depends on StateStore, Blacklist and RuntimeData. | 128 // ExtensionService depends on StateStore, Blacklist and RuntimeData. |
| 120 scoped_ptr<ExtensionService> extension_service_; | 129 scoped_ptr<ExtensionService> extension_service_; |
| 121 scoped_ptr<ManagementPolicy> management_policy_; | 130 scoped_ptr<ManagementPolicy> management_policy_; |
| 122 // extension_info_map_ needs to outlive process_manager_. | 131 // extension_info_map_ needs to outlive process_manager_. |
| 123 scoped_refptr<InfoMap> extension_info_map_; | 132 scoped_refptr<InfoMap> extension_info_map_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 147 // extension processes and those require access to the ResourceContext owned | 156 // extension processes and those require access to the ResourceContext owned |
| 148 // by |io_data_|. | 157 // by |io_data_|. |
| 149 scoped_ptr<ProcessManager> process_manager_; | 158 scoped_ptr<ProcessManager> process_manager_; |
| 150 | 159 |
| 151 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 160 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
| 152 }; | 161 }; |
| 153 | 162 |
| 154 } // namespace extensions | 163 } // namespace extensions |
| 155 | 164 |
| 156 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 165 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
| OLD | NEW |