Chromium Code Reviews| 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 pref once migration to per-partition | |
| 144 // zoom is complete. | |
| 139 registry->RegisterDoublePref( | 145 registry->RegisterDoublePref( |
| 146 prefs::kProfileDefaultZoomLevel, | |
|
Bernhard Bauer
2014/10/01 15:09:14
This is what I meant in my email: You're registeri
wjmaclean
2014/10/01 20:32:59
I assume this comment was intended for line 151 (b
| |
| 147 0.0, | |
| 148 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 149 std::string default_zoom_level_path(prefs::kDefaultZoomLevel); | |
| 150 default_zoom_level_path.append(".0"); | |
| 151 registry->RegisterDoublePref( | |
| 152 default_zoom_level_path.c_str(), | |
| 153 0.0, | |
| 154 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 155 registry->RegisterDictionaryPref( | |
| 140 prefs::kDefaultZoomLevel, | 156 prefs::kDefaultZoomLevel, |
| 141 0.0, | 157 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 158 // TODO(wjmaclean): remove the following pref once migration to per-partition | |
| 159 // zoom is complete. | |
| 160 registry->RegisterDictionaryPref( | |
| 161 prefs::kProfilePerHostZoomLevels, | |
| 142 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 162 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 143 registry->RegisterDictionaryPref( | 163 registry->RegisterDictionaryPref( |
| 144 prefs::kPerHostZoomLevels, | 164 prefs::kPerHostZoomLevels, |
| 145 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 146 registry->RegisterStringPref( | 166 registry->RegisterStringPref( |
| 147 prefs::kDefaultApps, | 167 prefs::kDefaultApps, |
| 148 "install", | 168 "install", |
| 149 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 150 registry->RegisterBooleanPref( | 170 registry->RegisterBooleanPref( |
| 151 prefs::kSpeechRecognitionFilterProfanities, | 171 prefs::kSpeechRecognitionFilterProfanities, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 content::NotificationService::NoDetails()); | 263 content::NotificationService::NoDetails()); |
| 244 } | 264 } |
| 245 } | 265 } |
| 246 | 266 |
| 247 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 267 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
| 248 DCHECK(a && b); | 268 DCHECK(a && b); |
| 249 if (a->IsSameProfile(b)) | 269 if (a->IsSameProfile(b)) |
| 250 return false; | 270 return false; |
| 251 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 271 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
| 252 } | 272 } |
| OLD | NEW |