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

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: Merge with upstream. Created 8 years, 5 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 HistoryService* history_service = 353 HistoryService* history_service =
354 HistoryServiceFactory::GetForProfileWithoutCreating(this).get(); 354 HistoryServiceFactory::GetForProfileWithoutCreating(this).get();
355 if (history_service) { 355 if (history_service) {
356 history_service->history_backend_->bookmark_service_ = 356 history_service->history_backend_->bookmark_service_ =
357 bookmark_service; 357 bookmark_service;
358 history_service->history_backend_->expirer_.bookmark_service_ = 358 history_service->history_backend_->expirer_.bookmark_service_ =
359 bookmark_service; 359 bookmark_service;
360 } 360 }
361 } 361 }
362 362
363 void TestingProfile::CreateProtocolHandlerRegistry() {
364 protocol_handler_registry_ = new ProtocolHandlerRegistry(this,
365 new ProtocolHandlerRegistry::Delegate());
366 }
367
368 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( 363 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService(
369 Profile* profile) { 364 Profile* profile) {
370 WebDataService* web_data_service = new WebDataService(); 365 WebDataService* web_data_service = new WebDataService();
371 if (web_data_service) 366 if (web_data_service)
372 web_data_service->Init(profile->GetPath()); 367 web_data_service->Init(profile->GetPath());
373 return web_data_service; 368 return web_data_service;
374 } 369 }
375 370
376 void TestingProfile::CreateWebDataService() { 371 void TestingProfile::CreateWebDataService() {
377 WebDataServiceFactory::GetInstance()->SetTestingFactory( 372 WebDataServiceFactory::GetInstance()->SetTestingFactory(
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 663
669 bool TestingProfile::IsSameProfile(Profile *p) { 664 bool TestingProfile::IsSameProfile(Profile *p) {
670 return this == p; 665 return this == p;
671 } 666 }
672 667
673 base::Time TestingProfile::GetStartTime() const { 668 base::Time TestingProfile::GetStartTime() const {
674 return start_time_; 669 return start_time_;
675 } 670 }
676 671
677 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() { 672 ProtocolHandlerRegistry* TestingProfile::GetProtocolHandlerRegistry() {
678 return protocol_handler_registry_.get(); 673 return NULL;
679 } 674 }
680 675
681 FilePath TestingProfile::last_selected_directory() { 676 FilePath TestingProfile::last_selected_directory() {
682 return last_selected_directory_; 677 return last_selected_directory_;
683 } 678 }
684 679
685 void TestingProfile::set_last_selected_directory(const FilePath& path) { 680 void TestingProfile::set_last_selected_directory(const FilePath& path) {
686 last_selected_directory_ = path; 681 last_selected_directory_ = path;
687 } 682 }
688 683
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 } 721 }
727 722
728 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { 723 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) {
729 return true; 724 return true;
730 } 725 }
731 726
732 base::Callback<ChromeURLDataManagerBackend*(void)> 727 base::Callback<ChromeURLDataManagerBackend*(void)>
733 TestingProfile::GetChromeURLDataManagerBackendGetter() const { 728 TestingProfile::GetChromeURLDataManagerBackendGetter() const {
734 return base::Callback<ChromeURLDataManagerBackend*(void)>(); 729 return base::Callback<ChromeURLDataManagerBackend*(void)>();
735 } 730 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698