Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 10546083: Convert ProtocolHandlerRegistry to be a ProfileKeyedService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix merge issue (correctly) in PHR test. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 HistoryService* history_service = 349 HistoryService* history_service =
350 HistoryServiceFactory::GetForProfileIfExists(this).get(); 350 HistoryServiceFactory::GetForProfileIfExists(this).get();
351 if (history_service) { 351 if (history_service) {
352 history_service->history_backend_->bookmark_service_ = 352 history_service->history_backend_->bookmark_service_ =
353 bookmark_service; 353 bookmark_service;
354 history_service->history_backend_->expirer_.bookmark_service_ = 354 history_service->history_backend_->expirer_.bookmark_service_ =
355 bookmark_service; 355 bookmark_service;
356 } 356 }
357 } 357 }
358 358
359 void TestingProfile::CreateProtocolHandlerRegistry() {
360 protocol_handler_registry_ = new ProtocolHandlerRegistry(this,
361 new ProtocolHandlerRegistry::Delegate());
362 }
363
364 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( 359 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService(
365 Profile* profile) { 360 Profile* profile) {
366 WebDataService* web_data_service = new WebDataService(); 361 WebDataService* web_data_service = new WebDataService();
367 if (web_data_service) 362 if (web_data_service)
368 web_data_service->Init(profile->GetPath()); 363 web_data_service->Init(profile->GetPath());
369 return web_data_service; 364 return web_data_service;
370 } 365 }
371 366
372 void TestingProfile::CreateWebDataService() { 367 void TestingProfile::CreateWebDataService() {
373 WebDataServiceFactory::GetInstance()->SetTestingFactory( 368 WebDataServiceFactory::GetInstance()->SetTestingFactory(
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 649
655 bool TestingProfile::IsSameProfile(Profile *p) { 650 bool TestingProfile::IsSameProfile(Profile *p) {
656 return this == p; 651 return this == p;
657 } 652 }
658 653
659 base::Time TestingProfile::GetStartTime() const { 654 base::Time TestingProfile::GetStartTime() const {
660 return start_time_; 655 return start_time_;
661 } 656 }
662 657
663 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() { 658 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() {
664 return protocol_handler_registry_.get(); 659 return NULL;
665 } 660 }
666 661
667 FilePath TestingProfile::last_selected_directory() { 662 FilePath TestingProfile::last_selected_directory() {
668 return last_selected_directory_; 663 return last_selected_directory_;
669 } 664 }
670 665
671 void TestingProfile::set_last_selected_directory(const FilePath& path) { 666 void TestingProfile::set_last_selected_directory(const FilePath& path) {
672 last_selected_directory_ = path; 667 last_selected_directory_ = path;
673 } 668 }
674 669
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 } 707 }
713 708
714 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { 709 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) {
715 return true; 710 return true;
716 } 711 }
717 712
718 base::Callback<ChromeURLDataManagerBackend*(void)> 713 base::Callback<ChromeURLDataManagerBackend*(void)>
719 TestingProfile::GetChromeURLDataManagerBackendGetter() const { 714 TestingProfile::GetChromeURLDataManagerBackendGetter() const {
720 return base::Callback<ChromeURLDataManagerBackend*(void)>(); 715 return base::Callback<ChromeURLDataManagerBackend*(void)>();
721 } 716 }
OLDNEW
« chrome/browser/profiles/profile_io_data.cc ('K') | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698