| 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/testing_profile.h" | 5 #include "chrome/test/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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 void TestingProfile::CreateTemplateURLModel() { | 338 void TestingProfile::CreateTemplateURLModel() { |
| 339 SetTemplateURLModel(new TemplateURLModel(this)); | 339 SetTemplateURLModel(new TemplateURLModel(this)); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void TestingProfile::SetTemplateURLModel(TemplateURLModel* model) { | 342 void TestingProfile::SetTemplateURLModel(TemplateURLModel* model) { |
| 343 template_url_model_.reset(model); | 343 template_url_model_.reset(model); |
| 344 } | 344 } |
| 345 | 345 |
| 346 ExtensionService* TestingProfile::CreateExtensionService( | 346 ExtensionService* TestingProfile::CreateExtensionService( |
| 347 const CommandLine* command_line, | 347 const CommandLine* command_line, |
| 348 const FilePath& install_directory) { | 348 const FilePath& install_directory, |
| 349 bool autoupdate_enabled) { |
| 349 // Extension pref store, created for use by |extension_prefs_|. | 350 // Extension pref store, created for use by |extension_prefs_|. |
| 350 | 351 |
| 351 extension_pref_value_map_.reset(new ExtensionPrefValueMap); | 352 extension_pref_value_map_.reset(new ExtensionPrefValueMap); |
| 352 // Note that the GetPrefs() creates a TestingPrefService, therefore | 353 // Note that the GetPrefs() creates a TestingPrefService, therefore |
| 353 // the extension controlled pref values set in extension_prefs_ | 354 // the extension controlled pref values set in extension_prefs_ |
| 354 // are not reflected in the pref service. One would need to | 355 // are not reflected in the pref service. One would need to |
| 355 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). | 356 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). |
| 356 extension_prefs_.reset( | 357 extension_prefs_.reset( |
| 357 new ExtensionPrefs(GetPrefs(), | 358 new ExtensionPrefs(GetPrefs(), |
| 358 install_directory, | 359 install_directory, |
| 359 extension_pref_value_map_.get())); | 360 extension_pref_value_map_.get())); |
| 360 extensions_service_ = new ExtensionService(this, | 361 extensions_service_ = new ExtensionService(this, |
| 361 command_line, | 362 command_line, |
| 362 install_directory, | 363 install_directory, |
| 363 extension_prefs_.get(), | 364 extension_prefs_.get(), |
| 364 false, | 365 autoupdate_enabled, |
| 365 true); | 366 true); |
| 366 return extensions_service_; | 367 return extensions_service_; |
| 367 } | 368 } |
| 368 | 369 |
| 369 FilePath TestingProfile::GetPath() { | 370 FilePath TestingProfile::GetPath() { |
| 370 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. | 371 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. |
| 371 return temp_dir_.path(); | 372 return temp_dir_.path(); |
| 372 } | 373 } |
| 373 | 374 |
| 374 TestingPrefService* TestingProfile::GetTestingPrefService() { | 375 TestingPrefService* TestingProfile::GetTestingPrefService() { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 } | 810 } |
| 810 | 811 |
| 811 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 812 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
| 812 : original_profile_(profile) {} | 813 : original_profile_(profile) {} |
| 813 | 814 |
| 814 DerivedTestingProfile::~DerivedTestingProfile() {} | 815 DerivedTestingProfile::~DerivedTestingProfile() {} |
| 815 | 816 |
| 816 ProfileId DerivedTestingProfile::GetRuntimeId() { | 817 ProfileId DerivedTestingProfile::GetRuntimeId() { |
| 817 return original_profile_->GetRuntimeId(); | 818 return original_profile_->GetRuntimeId(); |
| 818 } | 819 } |
| OLD | NEW |