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 #include "chrome/browser/extensions/extension_service_test_base.h" | 5 #include "chrome/browser/extensions/extension_service_test_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 // These are declared in the .cc so that all inheritors don't need to know | 296 // These are declared in the .cc so that all inheritors don't need to know |
297 // that TestingProfile derives Profile derives BrowserContext. | 297 // that TestingProfile derives Profile derives BrowserContext. |
298 content::BrowserContext* ExtensionServiceTestBase::browser_context() { | 298 content::BrowserContext* ExtensionServiceTestBase::browser_context() { |
299 return profile_.get(); | 299 return profile_.get(); |
300 } | 300 } |
301 | 301 |
302 Profile* ExtensionServiceTestBase::profile() { | 302 Profile* ExtensionServiceTestBase::profile() { |
303 return profile_.get(); | 303 return profile_.get(); |
304 } | 304 } |
305 | 305 |
306 sync_preferences::TestingPrefServiceSyncable* | |
307 ExtensionServiceTestBase::testing_pref_service() { | |
308 return profile_.get()->GetTestingPrefService(); | |
Devlin
2016/12/07 16:21:47
nit: .get() is unnecessary; just use profile_->Get
pmarko
2016/12/13 02:46:23
Done.
| |
309 } | |
310 | |
306 void ExtensionServiceTestBase::CreateExtensionService( | 311 void ExtensionServiceTestBase::CreateExtensionService( |
307 const ExtensionServiceInitParams& params) { | 312 const ExtensionServiceInitParams& params) { |
308 TestExtensionSystem* system = | 313 TestExtensionSystem* system = |
309 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); | 314 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(profile_.get())); |
310 if (!params.is_first_run) | 315 if (!params.is_first_run) |
311 ExtensionPrefs::Get(profile_.get())->SetAlertSystemFirstRun(); | 316 ExtensionPrefs::Get(profile_.get())->SetAlertSystemFirstRun(); |
312 | 317 |
313 service_ = | 318 service_ = |
314 system->CreateExtensionService(base::CommandLine::ForCurrentProcess(), | 319 system->CreateExtensionService(base::CommandLine::ForCurrentProcess(), |
315 params.extensions_install_dir, | 320 params.extensions_install_dir, |
(...skipping 14 matching lines...) Expand all Loading... | |
330 | 335 |
331 service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, | 336 service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, |
332 service_->shared_module_service()); | 337 service_->shared_module_service()); |
333 | 338 |
334 #if defined(OS_CHROMEOS) | 339 #if defined(OS_CHROMEOS) |
335 InstallLimiter::Get(profile_.get())->DisableForTest(); | 340 InstallLimiter::Get(profile_.get())->DisableForTest(); |
336 #endif | 341 #endif |
337 } | 342 } |
338 | 343 |
339 } // namespace extensions | 344 } // namespace extensions |
OLD | NEW |