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

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

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
32 #include "chrome/browser/history/history_db_task.h" 32 #include "chrome/browser/history/history_db_task.h"
33 #include "chrome/browser/history/history_service.h" 33 #include "chrome/browser/history/history_service.h"
34 #include "chrome/browser/history/history_service_factory.h" 34 #include "chrome/browser/history/history_service_factory.h"
35 #include "chrome/browser/history/shortcuts_backend.h" 35 #include "chrome/browser/history/shortcuts_backend.h"
36 #include "chrome/browser/history/shortcuts_backend_factory.h" 36 #include "chrome/browser/history/shortcuts_backend_factory.h"
37 #include "chrome/browser/history/top_sites.h" 37 #include "chrome/browser/history/top_sites.h"
38 #include "chrome/browser/net/proxy_service_factory.h" 38 #include "chrome/browser/net/proxy_service_factory.h"
39 #include "chrome/browser/notifications/desktop_notification_service.h" 39 #include "chrome/browser/notifications/desktop_notification_service.h"
40 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 40 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
41 #include "chrome/browser/prefs/browser_prefs.h" 41 #include "chrome/browser/prefs/browser_prefs.h"
42 #include "chrome/browser/prefs/pref_service_syncable.h"
42 #include "chrome/browser/prerender/prerender_manager.h" 43 #include "chrome/browser/prerender/prerender_manager.h"
43 #include "chrome/browser/profiles/profile_dependency_manager.h" 44 #include "chrome/browser/profiles/profile_dependency_manager.h"
44 #include "chrome/browser/profiles/storage_partition_descriptor.h" 45 #include "chrome/browser/profiles/storage_partition_descriptor.h"
45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" 46 #include "chrome/browser/search_engines/template_url_fetcher_factory.h"
46 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" 47 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h"
47 #include "chrome/browser/webdata/web_data_service.h" 48 #include "chrome/browser/webdata/web_data_service.h"
48 #include "chrome/browser/webdata/web_data_service_factory.h" 49 #include "chrome/browser/webdata/web_data_service_factory.h"
49 #include "chrome/common/chrome_constants.h" 50 #include "chrome/common/chrome_constants.h"
50 #include "chrome/common/chrome_notification_types.h" 51 #include "chrome/common/chrome_notification_types.h"
51 #include "chrome/common/chrome_switches.h" 52 #include "chrome/common/chrome_switches.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 553 }
553 554
554 void TestingProfile::SetPrefService(PrefServiceSyncable* prefs) { 555 void TestingProfile::SetPrefService(PrefServiceSyncable* prefs) {
555 prefs_.reset(prefs); 556 prefs_.reset(prefs);
556 } 557 }
557 558
558 void TestingProfile::CreateTestingPrefService() { 559 void TestingProfile::CreateTestingPrefService() {
559 DCHECK(!prefs_.get()); 560 DCHECK(!prefs_.get());
560 testing_prefs_ = new TestingPrefServiceSyncable(); 561 testing_prefs_ = new TestingPrefServiceSyncable();
561 prefs_.reset(testing_prefs_); 562 prefs_.reset(testing_prefs_);
562 Profile::RegisterUserPrefs(prefs_.get()); 563 Profile::RegisterUserPrefs(testing_prefs_->registry());
563 chrome::RegisterUserPrefs(prefs_.get()); 564 chrome::RegisterUserPrefs(testing_prefs_, testing_prefs_->registry());
564 } 565 }
565 566
566 PrefServiceSyncable* TestingProfile::GetPrefs() { 567 PrefService* TestingProfile::GetPrefs() {
567 if (!prefs_.get()) { 568 if (!prefs_.get()) {
568 CreateTestingPrefService(); 569 CreateTestingPrefService();
569 } 570 }
570 return prefs_.get(); 571 return prefs_.get();
571 } 572 }
572 573
573 history::TopSites* TestingProfile::GetTopSites() { 574 history::TopSites* TestingProfile::GetTopSites() {
574 return top_sites_.get(); 575 return top_sites_.get();
575 } 576 }
576 577
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 const base::Closure& completion) { 763 const base::Closure& completion) {
763 if (!completion.is_null()) { 764 if (!completion.is_null()) {
764 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); 765 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion);
765 } 766 }
766 } 767 }
767 768
768 GURL TestingProfile::GetHomePage() { 769 GURL TestingProfile::GetHomePage() {
769 return GURL(chrome::kChromeUINewTabURL); 770 return GURL(chrome::kChromeUINewTabURL);
770 } 771 }
771 772
772 PrefServiceSyncable* TestingProfile::GetOffTheRecordPrefs() { 773 PrefService* TestingProfile::GetOffTheRecordPrefs() {
773 return NULL; 774 return NULL;
774 } 775 }
775 776
776 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { 777 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() {
777 return GetExtensionSpecialStoragePolicy(); 778 return GetExtensionSpecialStoragePolicy();
778 } 779 }
779 780
780 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { 781 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) {
781 return true; 782 return true;
782 } 783 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 820 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
820 DCHECK(!build_called_); 821 DCHECK(!build_called_);
821 build_called_ = true; 822 build_called_ = true;
822 return scoped_ptr<TestingProfile>(new TestingProfile( 823 return scoped_ptr<TestingProfile>(new TestingProfile(
823 path_, 824 path_,
824 delegate_, 825 delegate_,
825 extension_policy_, 826 extension_policy_,
826 pref_service_.Pass(), 827 pref_service_.Pass(),
827 off_the_record_)); 828 off_the_record_));
828 } 829 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698