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/event_router.h" | 10 #include "chrome/browser/extensions/event_router.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 new StandardManagementPolicyProvider(ExtensionPrefs::Get(profile_))); | 93 new StandardManagementPolicyProvider(ExtensionPrefs::Get(profile_))); |
94 management_policy_.reset(new ManagementPolicy()); | 94 management_policy_.reset(new ManagementPolicy()); |
95 management_policy_->RegisterProvider( | 95 management_policy_->RegisterProvider( |
96 standard_management_policy_provider_.get()); | 96 standard_management_policy_provider_.get()); |
97 extension_service_.reset(new ExtensionService(profile_, | 97 extension_service_.reset(new ExtensionService(profile_, |
98 command_line, | 98 command_line, |
99 install_directory, | 99 install_directory, |
100 ExtensionPrefs::Get(profile_), | 100 ExtensionPrefs::Get(profile_), |
101 blacklist_.get(), | 101 blacklist_.get(), |
102 autoupdate_enabled, | 102 autoupdate_enabled, |
103 true)); | 103 true, |
| 104 &ready_)); |
104 extension_service_->ClearProvidersForTesting(); | 105 extension_service_->ClearProvidersForTesting(); |
105 return extension_service_.get(); | 106 return extension_service_.get(); |
106 } | 107 } |
107 | 108 |
108 ExtensionService* TestExtensionSystem::extension_service() { | 109 ExtensionService* TestExtensionSystem::extension_service() { |
109 return extension_service_.get(); | 110 return extension_service_.get(); |
110 } | 111 } |
111 | 112 |
112 ManagementPolicy* TestExtensionSystem::management_policy() { | 113 ManagementPolicy* TestExtensionSystem::management_policy() { |
113 return management_policy_.get(); | 114 return management_policy_.get(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 170 } |
170 | 171 |
171 ExtensionWarningService* TestExtensionSystem::warning_service() { | 172 ExtensionWarningService* TestExtensionSystem::warning_service() { |
172 return NULL; | 173 return NULL; |
173 } | 174 } |
174 | 175 |
175 Blacklist* TestExtensionSystem::blacklist() { | 176 Blacklist* TestExtensionSystem::blacklist() { |
176 return blacklist_.get(); | 177 return blacklist_.get(); |
177 } | 178 } |
178 | 179 |
| 180 const OneShotEvent& TestExtensionSystem::ready() const { |
| 181 return ready_; |
| 182 } |
| 183 |
179 // static | 184 // static |
180 ProfileKeyedService* TestExtensionSystem::Build( | 185 ProfileKeyedService* TestExtensionSystem::Build( |
181 content::BrowserContext* profile) { | 186 content::BrowserContext* profile) { |
182 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 187 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
183 } | 188 } |
184 | 189 |
185 } // namespace extensions | 190 } // namespace extensions |
OLD | NEW |