Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 this, BuildTemplateURLService); | 337 this, BuildTemplateURLService); |
| 338 } | 338 } |
| 339 | 339 |
| 340 ExtensionService* TestingProfile::CreateExtensionService( | 340 ExtensionService* TestingProfile::CreateExtensionService( |
| 341 const CommandLine* command_line, | 341 const CommandLine* command_line, |
| 342 const FilePath& install_directory, | 342 const FilePath& install_directory, |
| 343 bool autoupdate_enabled) { | 343 bool autoupdate_enabled) { |
| 344 // Extension pref store, created for use by |extension_prefs_|. | 344 // Extension pref store, created for use by |extension_prefs_|. |
| 345 | 345 |
| 346 extension_pref_value_map_.reset(new ExtensionPrefValueMap); | 346 extension_pref_value_map_.reset(new ExtensionPrefValueMap); |
| 347 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | |
|
Matt Perry
2011/10/27 18:05:28
we might not want to do this all the time. i think
| |
| 347 | 348 |
| 348 bool extensions_disabled = | 349 bool extensions_disabled = |
| 349 command_line && command_line->HasSwitch(switches::kDisableExtensions); | 350 command_line && command_line->HasSwitch(switches::kDisableExtensions); |
| 350 | 351 |
| 351 // Note that the GetPrefs() creates a TestingPrefService, therefore | 352 // Note that the GetPrefs() creates a TestingPrefService, therefore |
| 352 // the extension controlled pref values set in extension_prefs_ | 353 // the extension controlled pref values set in extension_prefs_ |
| 353 // are not reflected in the pref service. One would need to | 354 // are not reflected in the pref service. One would need to |
| 354 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). | 355 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). |
| 355 extension_prefs_.reset( | 356 extension_prefs_.reset( |
| 356 new ExtensionPrefs(GetPrefs(), | 357 new ExtensionPrefs(GetPrefs(), |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 | 434 |
| 434 UserScriptMaster* TestingProfile::GetUserScriptMaster() { | 435 UserScriptMaster* TestingProfile::GetUserScriptMaster() { |
| 435 return NULL; | 436 return NULL; |
| 436 } | 437 } |
| 437 | 438 |
| 438 ExtensionDevToolsManager* TestingProfile::GetExtensionDevToolsManager() { | 439 ExtensionDevToolsManager* TestingProfile::GetExtensionDevToolsManager() { |
| 439 return NULL; | 440 return NULL; |
| 440 } | 441 } |
| 441 | 442 |
| 442 ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { | 443 ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { |
| 443 return NULL; | 444 return extension_process_manager_.get(); |
| 444 } | 445 } |
| 445 | 446 |
| 446 ExtensionMessageService* TestingProfile::GetExtensionMessageService() { | 447 ExtensionMessageService* TestingProfile::GetExtensionMessageService() { |
| 447 return NULL; | 448 return NULL; |
| 448 } | 449 } |
| 449 | 450 |
| 450 ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { | 451 ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { |
| 451 return NULL; | 452 return NULL; |
| 452 } | 453 } |
| 453 | 454 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 789 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
| 789 return GetExtensionSpecialStoragePolicy(); | 790 return GetExtensionSpecialStoragePolicy(); |
| 790 } | 791 } |
| 791 | 792 |
| 792 void TestingProfile::DestroyWebDataService() { | 793 void TestingProfile::DestroyWebDataService() { |
| 793 if (!web_data_service_.get()) | 794 if (!web_data_service_.get()) |
| 794 return; | 795 return; |
| 795 | 796 |
| 796 web_data_service_->Shutdown(); | 797 web_data_service_->Shutdown(); |
| 797 } | 798 } |
| OLD | NEW |