| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 extension_pref_value_map_.get())); | 340 extension_pref_value_map_.get())); |
| 341 extension_service_.reset(new ExtensionService(this, | 341 extension_service_.reset(new ExtensionService(this, |
| 342 command_line, | 342 command_line, |
| 343 install_directory, | 343 install_directory, |
| 344 extension_prefs_.get(), | 344 extension_prefs_.get(), |
| 345 autoupdate_enabled, | 345 autoupdate_enabled, |
| 346 true)); | 346 true)); |
| 347 return extension_service_.get(); | 347 return extension_service_.get(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void TestingProfile::SetAppCacheService( |
| 351 ChromeAppCacheService* appcache_service) { |
| 352 appcache_service_ = appcache_service; |
| 353 } |
| 354 |
| 350 FilePath TestingProfile::GetPath() { | 355 FilePath TestingProfile::GetPath() { |
| 351 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. | 356 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. |
| 352 return temp_dir_.path(); | 357 return temp_dir_.path(); |
| 353 } | 358 } |
| 354 | 359 |
| 355 TestingPrefService* TestingProfile::GetTestingPrefService() { | 360 TestingPrefService* TestingProfile::GetTestingPrefService() { |
| 356 if (!prefs_.get()) | 361 if (!prefs_.get()) |
| 357 CreateTestingPrefService(); | 362 CreateTestingPrefService(); |
| 358 DCHECK(testing_prefs_); | 363 DCHECK(testing_prefs_); |
| 359 return testing_prefs_; | 364 return testing_prefs_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 385 | 390 |
| 386 bool TestingProfile::HasOffTheRecordProfile() { | 391 bool TestingProfile::HasOffTheRecordProfile() { |
| 387 return incognito_profile_.get() != NULL; | 392 return incognito_profile_.get() != NULL; |
| 388 } | 393 } |
| 389 | 394 |
| 390 Profile* TestingProfile::GetOriginalProfile() { | 395 Profile* TestingProfile::GetOriginalProfile() { |
| 391 return this; | 396 return this; |
| 392 } | 397 } |
| 393 | 398 |
| 394 ChromeAppCacheService* TestingProfile::GetAppCacheService() { | 399 ChromeAppCacheService* TestingProfile::GetAppCacheService() { |
| 395 return NULL; | 400 return appcache_service_.get(); |
| 396 } | 401 } |
| 397 | 402 |
| 398 webkit_database::DatabaseTracker* TestingProfile::GetDatabaseTracker() { | 403 webkit_database::DatabaseTracker* TestingProfile::GetDatabaseTracker() { |
| 399 if (!db_tracker_) { | 404 if (!db_tracker_) { |
| 400 db_tracker_ = new webkit_database::DatabaseTracker( | 405 db_tracker_ = new webkit_database::DatabaseTracker( |
| 401 GetPath(), false, false, GetExtensionSpecialStoragePolicy(), | 406 GetPath(), false, false, GetExtensionSpecialStoragePolicy(), |
| 402 NULL, NULL); | 407 NULL, NULL); |
| 403 } | 408 } |
| 404 return db_tracker_; | 409 return db_tracker_; |
| 405 } | 410 } |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 } | 794 } |
| 790 | 795 |
| 791 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 796 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
| 792 : original_profile_(profile) {} | 797 : original_profile_(profile) {} |
| 793 | 798 |
| 794 DerivedTestingProfile::~DerivedTestingProfile() {} | 799 DerivedTestingProfile::~DerivedTestingProfile() {} |
| 795 | 800 |
| 796 ProfileId DerivedTestingProfile::GetRuntimeId() { | 801 ProfileId DerivedTestingProfile::GetRuntimeId() { |
| 797 return original_profile_->GetRuntimeId(); | 802 return original_profile_->GetRuntimeId(); |
| 798 } | 803 } |
| OLD | NEW |