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

Side by Side Diff: chrome/browser/profiles/profile.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | 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/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 TestingProfile* Profile::AsTestingProfile() { 42 TestingProfile* Profile::AsTestingProfile() {
43 return NULL; 43 return NULL;
44 } 44 }
45 45
46 // static 46 // static
47 const char* const Profile::kProfileKey = "__PROFILE__"; 47 const char* const Profile::kProfileKey = "__PROFILE__";
48 48
49 // static 49 // static
50 void Profile::RegisterUserPrefs(PrefService* prefs) { 50 void Profile::RegisterUserPrefs(PrefServiceSyncable* prefs) {
51 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, 51 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled,
52 true, 52 true,
53 PrefService::SYNCABLE_PREF); 53 PrefServiceSyncable::SYNCABLE_PREF);
54 prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, 54 prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly,
55 true, 55 true,
56 PrefService::UNSYNCABLE_PREF); 56 PrefServiceSyncable::UNSYNCABLE_PREF);
57 prefs->RegisterStringPref(prefs::kSessionExitType, 57 prefs->RegisterStringPref(prefs::kSessionExitType,
58 std::string(), 58 std::string(),
59 PrefService::UNSYNCABLE_PREF); 59 PrefServiceSyncable::UNSYNCABLE_PREF);
60 prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, 60 prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled,
61 true, 61 true,
62 PrefService::SYNCABLE_PREF); 62 PrefServiceSyncable::SYNCABLE_PREF);
63 prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled, 63 prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled,
64 false, 64 false,
65 PrefService::UNSYNCABLE_PREF); 65 PrefServiceSyncable::UNSYNCABLE_PREF);
66 prefs->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled, 66 prefs->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled,
67 false, 67 false,
68 PrefService::UNSYNCABLE_PREF); 68 PrefServiceSyncable::UNSYNCABLE_PREF);
69 prefs->RegisterBooleanPref(prefs::kDisableExtensions, 69 prefs->RegisterBooleanPref(prefs::kDisableExtensions,
70 false, 70 false,
71 PrefService::UNSYNCABLE_PREF); 71 PrefServiceSyncable::UNSYNCABLE_PREF);
72 prefs->RegisterBooleanPref(prefs::kExtensionAlertsInitializedPref, 72 prefs->RegisterBooleanPref(prefs::kExtensionAlertsInitializedPref,
73 false, PrefService::UNSYNCABLE_PREF); 73 false, PrefServiceSyncable::UNSYNCABLE_PREF);
74 prefs->RegisterStringPref(prefs::kSelectFileLastDirectory, 74 prefs->RegisterStringPref(prefs::kSelectFileLastDirectory,
75 std::string(), 75 std::string(),
76 PrefService::UNSYNCABLE_PREF); 76 PrefServiceSyncable::UNSYNCABLE_PREF);
77 prefs->RegisterDoublePref(prefs::kDefaultZoomLevel, 77 prefs->RegisterDoublePref(prefs::kDefaultZoomLevel,
78 0.0, 78 0.0,
79 PrefService::UNSYNCABLE_PREF); 79 PrefServiceSyncable::UNSYNCABLE_PREF);
80 prefs->RegisterDictionaryPref(prefs::kPerHostZoomLevels, 80 prefs->RegisterDictionaryPref(prefs::kPerHostZoomLevels,
81 PrefService::UNSYNCABLE_PREF); 81 PrefServiceSyncable::UNSYNCABLE_PREF);
82 prefs->RegisterStringPref(prefs::kDefaultApps, 82 prefs->RegisterStringPref(prefs::kDefaultApps,
83 "install", 83 "install",
84 PrefService::UNSYNCABLE_PREF); 84 PrefServiceSyncable::UNSYNCABLE_PREF);
85 #if defined(OS_CHROMEOS) 85 #if defined(OS_CHROMEOS)
86 // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both 86 // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both
87 // local state and user's profile. For other platforms we maintain 87 // local state and user's profile. For other platforms we maintain
88 // kApplicationLocale only in local state. 88 // kApplicationLocale only in local state.
89 // In the future we may want to maintain kApplicationLocale 89 // In the future we may want to maintain kApplicationLocale
90 // in user's profile for other platforms as well. 90 // in user's profile for other platforms as well.
91 prefs->RegisterStringPref(prefs::kApplicationLocale, 91 prefs->RegisterStringPref(prefs::kApplicationLocale,
92 std::string(), 92 std::string(),
93 PrefService::SYNCABLE_PREF); 93 PrefServiceSyncable::SYNCABLE_PREF);
94 prefs->RegisterStringPref(prefs::kApplicationLocaleBackup, 94 prefs->RegisterStringPref(prefs::kApplicationLocaleBackup,
95 std::string(), 95 std::string(),
96 PrefService::UNSYNCABLE_PREF); 96 PrefServiceSyncable::UNSYNCABLE_PREF);
97 prefs->RegisterStringPref(prefs::kApplicationLocaleAccepted, 97 prefs->RegisterStringPref(prefs::kApplicationLocaleAccepted,
98 std::string(), 98 std::string(),
99 PrefService::UNSYNCABLE_PREF); 99 PrefServiceSyncable::UNSYNCABLE_PREF);
100 #endif 100 #endif
101 101
102 #if defined(OS_ANDROID) 102 #if defined(OS_ANDROID)
103 prefs->RegisterBooleanPref(prefs::kDevToolsRemoteEnabled, 103 prefs->RegisterBooleanPref(prefs::kDevToolsRemoteEnabled,
104 false, 104 false,
105 PrefService::UNSYNCABLE_PREF); 105 PrefServiceSyncable::UNSYNCABLE_PREF);
106 prefs->RegisterBooleanPref(prefs::kSpdyProxyEnabled, 106 prefs->RegisterBooleanPref(prefs::kSpdyProxyEnabled,
107 false, 107 false,
108 PrefService::UNSYNCABLE_PREF); 108 PrefServiceSyncable::UNSYNCABLE_PREF);
109 #endif 109 #endif
110 110
111 } 111 }
112 112
113 113
114 std::string Profile::GetDebugName() { 114 std::string Profile::GetDebugName() {
115 std::string name = GetPath().BaseName().MaybeAsASCII(); 115 std::string name = GetPath().BaseName().MaybeAsASCII();
116 if (name.empty()) { 116 if (name.empty()) {
117 name = "UnknownProfile"; 117 name = "UnknownProfile";
118 } 118 }
(...skipping 17 matching lines...) Expand all
136 136
137 void Profile::MaybeSendDestroyedNotification() { 137 void Profile::MaybeSendDestroyedNotification() {
138 if (!sent_destroyed_notification_) { 138 if (!sent_destroyed_notification_) {
139 sent_destroyed_notification_ = true; 139 sent_destroyed_notification_ = true;
140 content::NotificationService::current()->Notify( 140 content::NotificationService::current()->Notify(
141 chrome::NOTIFICATION_PROFILE_DESTROYED, 141 chrome::NOTIFICATION_PROFILE_DESTROYED,
142 content::Source<Profile>(this), 142 content::Source<Profile>(this),
143 content::NotificationService::NoDetails()); 143 content::NotificationService::NoDetails());
144 } 144 }
145 } 145 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698