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