| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void UnregisterExtensionWithRequestContexts( | 50 void UnregisterExtensionWithRequestContexts( |
| 51 const std::string& extension_id, | 51 const std::string& extension_id, |
| 52 const UnloadedExtensionInfo::Reason reason) override; | 52 const UnloadedExtensionInfo::Reason reason) override; |
| 53 | 53 |
| 54 const OneShotEvent& ready() const override; | 54 const OneShotEvent& ready() const override; |
| 55 ContentVerifier* content_verifier() override; // shared | 55 ContentVerifier* content_verifier() override; // shared |
| 56 scoped_ptr<ExtensionSet> GetDependentExtensions( | 56 scoped_ptr<ExtensionSet> GetDependentExtensions( |
| 57 const Extension* extension) override; | 57 const Extension* extension) override; |
| 58 | 58 |
| 59 SidebarManager* sidebar_manager() override; // shared |
| 60 |
| 59 private: | 61 private: |
| 60 friend class ExtensionSystemSharedFactory; | 62 friend class ExtensionSystemSharedFactory; |
| 61 | 63 |
| 62 // Owns the Extension-related systems that have a single instance | 64 // Owns the Extension-related systems that have a single instance |
| 63 // shared between normal and incognito profiles. | 65 // shared between normal and incognito profiles. |
| 64 class Shared : public KeyedService { | 66 class Shared : public KeyedService { |
| 65 public: | 67 public: |
| 66 explicit Shared(Profile* profile); | 68 explicit Shared(Profile* profile); |
| 67 ~Shared() override; | 69 ~Shared() override; |
| 68 | 70 |
| 69 // Initialization takes place in phases. | 71 // Initialization takes place in phases. |
| 70 virtual void InitPrefs(); | 72 virtual void InitPrefs(); |
| 71 // This must not be called until all the providers have been created. | 73 // This must not be called until all the providers have been created. |
| 72 void RegisterManagementPolicyProviders(); | 74 void RegisterManagementPolicyProviders(); |
| 73 void Init(bool extensions_enabled); | 75 void Init(bool extensions_enabled); |
| 74 | 76 |
| 75 // KeyedService implementation. | 77 // KeyedService implementation. |
| 76 void Shutdown() override; | 78 void Shutdown() override; |
| 77 | 79 |
| 78 StateStore* state_store(); | 80 StateStore* state_store(); |
| 79 StateStore* rules_store(); | 81 StateStore* rules_store(); |
| 80 ExtensionService* extension_service(); | 82 ExtensionService* extension_service(); |
| 81 RuntimeData* runtime_data(); | 83 RuntimeData* runtime_data(); |
| 82 ManagementPolicy* management_policy(); | 84 ManagementPolicy* management_policy(); |
| 83 SharedUserScriptMaster* shared_user_script_master(); | 85 SharedUserScriptMaster* shared_user_script_master(); |
| 84 InfoMap* info_map(); | 86 InfoMap* info_map(); |
| 85 QuotaService* quota_service(); | 87 QuotaService* quota_service(); |
| 86 const OneShotEvent& ready() const { return ready_; } | 88 const OneShotEvent& ready() const { return ready_; } |
| 87 ContentVerifier* content_verifier(); | 89 ContentVerifier* content_verifier(); |
| 90 SidebarManager* sidebar_manager(); |
| 88 | 91 |
| 89 private: | 92 private: |
| 90 Profile* profile_; | 93 Profile* profile_; |
| 91 | 94 |
| 92 // The services that are shared between normal and incognito profiles. | 95 // The services that are shared between normal and incognito profiles. |
| 93 | 96 |
| 94 scoped_ptr<StateStore> state_store_; | 97 scoped_ptr<StateStore> state_store_; |
| 95 scoped_ptr<StateStoreNotificationObserver> | 98 scoped_ptr<StateStoreNotificationObserver> |
| 96 state_store_notification_observer_; | 99 state_store_notification_observer_; |
| 97 scoped_ptr<StateStore> rules_store_; | 100 scoped_ptr<StateStore> rules_store_; |
| 98 scoped_ptr<NavigationObserver> navigation_observer_; | 101 scoped_ptr<NavigationObserver> navigation_observer_; |
| 99 // Shared memory region manager for scripts statically declared in extension | 102 // Shared memory region manager for scripts statically declared in extension |
| 100 // manifests. This region is shared between all extensions. | 103 // manifests. This region is shared between all extensions. |
| 101 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_; | 104 scoped_ptr<SharedUserScriptMaster> shared_user_script_master_; |
| 102 scoped_ptr<RuntimeData> runtime_data_; | 105 scoped_ptr<RuntimeData> runtime_data_; |
| 103 // ExtensionService depends on StateStore, Blacklist and RuntimeData. | 106 // ExtensionService depends on StateStore, Blacklist and RuntimeData. |
| 104 scoped_ptr<ExtensionService> extension_service_; | 107 scoped_ptr<ExtensionService> extension_service_; |
| 105 scoped_ptr<ManagementPolicy> management_policy_; | 108 scoped_ptr<ManagementPolicy> management_policy_; |
| 106 // extension_info_map_ needs to outlive process_manager_. | 109 // extension_info_map_ needs to outlive process_manager_. |
| 107 scoped_refptr<InfoMap> extension_info_map_; | 110 scoped_refptr<InfoMap> extension_info_map_; |
| 108 scoped_ptr<QuotaService> quota_service_; | 111 scoped_ptr<QuotaService> quota_service_; |
| 109 | 112 |
| 110 // For verifying the contents of extensions read from disk. | 113 // For verifying the contents of extensions read from disk. |
| 111 scoped_refptr<ContentVerifier> content_verifier_; | 114 scoped_refptr<ContentVerifier> content_verifier_; |
| 112 | 115 |
| 116 scoped_ptr<SidebarManager> sidebar_manager_; |
| 117 |
| 113 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| 114 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> | 119 scoped_ptr<chromeos::DeviceLocalAccountManagementPolicyProvider> |
| 115 device_local_account_management_policy_provider_; | 120 device_local_account_management_policy_provider_; |
| 116 #endif | 121 #endif |
| 117 | 122 |
| 118 OneShotEvent ready_; | 123 OneShotEvent ready_; |
| 119 }; | 124 }; |
| 120 | 125 |
| 121 Profile* profile_; | 126 Profile* profile_; |
| 122 | 127 |
| 123 Shared* shared_; | 128 Shared* shared_; |
| 124 | 129 |
| 125 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 130 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
| 126 }; | 131 }; |
| 127 | 132 |
| 128 } // namespace extensions | 133 } // namespace extensions |
| 129 | 134 |
| 130 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_IMPL_H_ |
| OLD | NEW |