OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/test_extension_system.h" | 5 #include "chrome/browser/extensions/test_extension_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/extensions/blacklist.h" | 9 #include "chrome/browser/extensions/blacklist.h" |
10 #include "chrome/browser/extensions/declarative_user_script_master.h" | 10 #include "chrome/browser/extensions/declarative_user_script_master.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 install_verifier_.reset( | 93 install_verifier_.reset( |
94 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); | 94 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); |
95 // The ownership of |value_store_| is immediately transferred to state_store_, | 95 // The ownership of |value_store_| is immediately transferred to state_store_, |
96 // but we keep a naked pointer to the TestingValueStore. | 96 // but we keep a naked pointer to the TestingValueStore. |
97 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); | 97 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); |
98 value_store_ = value_store.get(); | 98 value_store_ = value_store.get(); |
99 state_store_.reset( | 99 state_store_.reset( |
100 new StateStore(profile_, value_store.PassAs<ValueStore>())); | 100 new StateStore(profile_, value_store.PassAs<ValueStore>())); |
101 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); | 101 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); |
102 management_policy_.reset(new ManagementPolicy()); | 102 management_policy_.reset(new ManagementPolicy()); |
103 management_policy_->RegisterProvider( | 103 management_policy_->RegisterProviders( |
104 ExtensionManagementFactory::GetForBrowserContext(profile_) | 104 ExtensionManagementFactory::GetForBrowserContext(profile_) |
105 ->GetProvider()); | 105 ->GetProviders()); |
106 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); | 106 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); |
107 extension_service_.reset(new ExtensionService(profile_, | 107 extension_service_.reset(new ExtensionService(profile_, |
108 command_line, | 108 command_line, |
109 install_directory, | 109 install_directory, |
110 ExtensionPrefs::Get(profile_), | 110 ExtensionPrefs::Get(profile_), |
111 blacklist_.get(), | 111 blacklist_.get(), |
112 autoupdate_enabled, | 112 autoupdate_enabled, |
113 true, | 113 true, |
114 &ready_)); | 114 &ready_)); |
115 extension_service_->ClearProvidersForTesting(); | 115 extension_service_->ClearProvidersForTesting(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 } | 215 } |
216 return master; | 216 return master; |
217 } | 217 } |
218 | 218 |
219 // static | 219 // static |
220 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { | 220 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { |
221 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 221 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
222 } | 222 } |
223 | 223 |
224 } // namespace extensions | 224 } // namespace extensions |
OLD | NEW |