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/browser/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // static | 54 // static |
55 Profile* Profile::FromWebUI(content::WebUI* web_ui) { | 55 Profile* Profile::FromWebUI(content::WebUI* web_ui) { |
56 return FromBrowserContext(web_ui->GetWebContents()->GetBrowserContext()); | 56 return FromBrowserContext(web_ui->GetWebContents()->GetBrowserContext()); |
57 } | 57 } |
58 | 58 |
59 TestingProfile* Profile::AsTestingProfile() { | 59 TestingProfile* Profile::AsTestingProfile() { |
60 return NULL; | 60 return NULL; |
61 } | 61 } |
62 | 62 |
| 63 chrome::ChromeZoomLevelPrefs* Profile::GetZoomLevelPrefs() { |
| 64 return NULL; |
| 65 } |
| 66 |
63 Profile::Delegate::~Delegate() { | 67 Profile::Delegate::~Delegate() { |
64 } | 68 } |
65 | 69 |
66 // static | 70 // static |
67 const char Profile::kProfileKey[] = "__PROFILE__"; | 71 const char Profile::kProfileKey[] = "__PROFILE__"; |
68 | 72 |
69 // static | 73 // static |
70 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 74 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
71 registry->RegisterBooleanPref( | 75 registry->RegisterBooleanPref( |
72 prefs::kSearchSuggestEnabled, | 76 prefs::kSearchSuggestEnabled, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 #if defined(ENABLE_EXTENSIONS) | 133 #if defined(ENABLE_EXTENSIONS) |
130 registry->RegisterBooleanPref( | 134 registry->RegisterBooleanPref( |
131 extensions::pref_names::kAlertsInitialized, | 135 extensions::pref_names::kAlertsInitialized, |
132 false, | 136 false, |
133 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 137 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
134 #endif | 138 #endif |
135 registry->RegisterStringPref( | 139 registry->RegisterStringPref( |
136 prefs::kSelectFileLastDirectory, | 140 prefs::kSelectFileLastDirectory, |
137 std::string(), | 141 std::string(), |
138 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 142 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 143 // TODO(wjmaclean): remove the following two prefs once migration to per- |
| 144 // partition zoom is complete. |
139 registry->RegisterDoublePref( | 145 registry->RegisterDoublePref( |
| 146 prefs::kProfileDefaultZoomLevel, |
| 147 0.0, |
| 148 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 149 registry->RegisterDictionaryPref( |
| 150 prefs::kProfilePerHostZoomLevels, |
| 151 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 152 |
| 153 registry->RegisterDictionaryPref( |
140 prefs::kDefaultZoomLevel, | 154 prefs::kDefaultZoomLevel, |
141 0.0, | |
142 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 155 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
143 registry->RegisterDictionaryPref( | 156 registry->RegisterDictionaryPref( |
144 prefs::kPerHostZoomLevels, | 157 prefs::kPerHostZoomLevels, |
145 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 158 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
146 registry->RegisterStringPref( | 159 registry->RegisterStringPref( |
147 prefs::kDefaultApps, | 160 prefs::kDefaultApps, |
148 "install", | 161 "install", |
149 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 162 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
150 registry->RegisterBooleanPref( | 163 registry->RegisterBooleanPref( |
151 prefs::kSpeechRecognitionFilterProfanities, | 164 prefs::kSpeechRecognitionFilterProfanities, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 content::NotificationService::NoDetails()); | 256 content::NotificationService::NoDetails()); |
244 } | 257 } |
245 } | 258 } |
246 | 259 |
247 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 260 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
248 DCHECK(a && b); | 261 DCHECK(a && b); |
249 if (a->IsSameProfile(b)) | 262 if (a->IsSameProfile(b)) |
250 return false; | 263 return false; |
251 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 264 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
252 } | 265 } |
OLD | NEW |