| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 HistoryService* history_service = | 350 HistoryService* history_service = |
| 351 HistoryServiceFactory::GetForProfileIfExists(this).get(); | 351 HistoryServiceFactory::GetForProfileIfExists(this).get(); |
| 352 if (history_service) { | 352 if (history_service) { |
| 353 history_service->history_backend_->bookmark_service_ = | 353 history_service->history_backend_->bookmark_service_ = |
| 354 bookmark_service; | 354 bookmark_service; |
| 355 history_service->history_backend_->expirer_.bookmark_service_ = | 355 history_service->history_backend_->expirer_.bookmark_service_ = |
| 356 bookmark_service; | 356 bookmark_service; |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 void TestingProfile::CreateProtocolHandlerRegistry() { | |
| 361 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, | |
| 362 new ProtocolHandlerRegistry::Delegate()); | |
| 363 } | |
| 364 | |
| 365 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( | 360 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( |
| 366 Profile* profile) { | 361 Profile* profile) { |
| 367 WebDataService* web_data_service = new WebDataService(); | 362 WebDataService* web_data_service = new WebDataService(); |
| 368 if (web_data_service) | 363 if (web_data_service) |
| 369 web_data_service->Init(profile->GetPath()); | 364 web_data_service->Init(profile->GetPath()); |
| 370 return web_data_service; | 365 return web_data_service; |
| 371 } | 366 } |
| 372 | 367 |
| 373 void TestingProfile::CreateWebDataService() { | 368 void TestingProfile::CreateWebDataService() { |
| 374 WebDataServiceFactory::GetInstance()->SetTestingFactory( | 369 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 652 |
| 658 bool TestingProfile::IsSameProfile(Profile *p) { | 653 bool TestingProfile::IsSameProfile(Profile *p) { |
| 659 return this == p; | 654 return this == p; |
| 660 } | 655 } |
| 661 | 656 |
| 662 base::Time TestingProfile::GetStartTime() const { | 657 base::Time TestingProfile::GetStartTime() const { |
| 663 return start_time_; | 658 return start_time_; |
| 664 } | 659 } |
| 665 | 660 |
| 666 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() { | 661 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() { |
| 667 return protocol_handler_registry_.get(); | 662 return NULL; |
| 668 } | 663 } |
| 669 | 664 |
| 670 FilePath TestingProfile::last_selected_directory() { | 665 FilePath TestingProfile::last_selected_directory() { |
| 671 return last_selected_directory_; | 666 return last_selected_directory_; |
| 672 } | 667 } |
| 673 | 668 |
| 674 void TestingProfile::set_last_selected_directory(const FilePath& path) { | 669 void TestingProfile::set_last_selected_directory(const FilePath& path) { |
| 675 last_selected_directory_ = path; | 670 last_selected_directory_ = path; |
| 676 } | 671 } |
| 677 | 672 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 } | 710 } |
| 716 | 711 |
| 717 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 712 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 718 return true; | 713 return true; |
| 719 } | 714 } |
| 720 | 715 |
| 721 base::Callback<ChromeURLDataManagerBackend*(void)> | 716 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 722 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 717 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
| 723 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 718 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
| 724 } | 719 } |
| OLD | NEW |