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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 CreateExtensionPrefs(command_line, install_directory); | 82 CreateExtensionPrefs(command_line, install_directory); |
83 install_verifier_.reset( | 83 install_verifier_.reset( |
84 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); | 84 new InstallVerifier(ExtensionPrefs::Get(profile_), profile_)); |
85 // The ownership of |value_store_| is immediately transferred to state_store_, | 85 // The ownership of |value_store_| is immediately transferred to state_store_, |
86 // but we keep a naked pointer to the TestingValueStore. | 86 // but we keep a naked pointer to the TestingValueStore. |
87 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); | 87 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); |
88 value_store_ = value_store.get(); | 88 value_store_ = value_store.get(); |
89 state_store_.reset(new StateStore(profile_, value_store.Pass())); | 89 state_store_.reset(new StateStore(profile_, value_store.Pass())); |
90 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); | 90 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); |
91 management_policy_.reset(new ManagementPolicy()); | 91 management_policy_.reset(new ManagementPolicy()); |
92 management_policy_->RegisterProvider( | 92 management_policy_->RegisterProviders( |
93 ExtensionManagementFactory::GetForBrowserContext(profile_) | 93 ExtensionManagementFactory::GetForBrowserContext(profile_) |
94 ->GetProvider()); | 94 ->GetProviders()); |
95 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); | 95 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); |
96 extension_service_.reset(new ExtensionService(profile_, | 96 extension_service_.reset(new ExtensionService(profile_, |
97 command_line, | 97 command_line, |
98 install_directory, | 98 install_directory, |
99 ExtensionPrefs::Get(profile_), | 99 ExtensionPrefs::Get(profile_), |
100 blacklist_.get(), | 100 blacklist_.get(), |
101 autoupdate_enabled, | 101 autoupdate_enabled, |
102 true, | 102 true, |
103 &ready_)); | 103 &ready_)); |
104 extension_service_->ClearProvidersForTesting(); | 104 extension_service_->ClearProvidersForTesting(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 return master; | 201 return master; |
202 } | 202 } |
203 | 203 |
204 // static | 204 // static |
205 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { | 205 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { |
206 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 206 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
207 } | 207 } |
208 | 208 |
209 } // namespace extensions | 209 } // namespace extensions |
OLD | NEW |