| 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 // This must be a string which can never be a valid domain. | 72 // This must be a string which can never be a valid domain. |
| 69 const char Profile::kNoHostedDomainFound[] = "NO_HOSTED_DOMAIN"; | 73 const char Profile::kNoHostedDomainFound[] = "NO_HOSTED_DOMAIN"; |
| 70 | 74 |
| 71 // static | 75 // static |
| 72 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 76 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 #if defined(ENABLE_EXTENSIONS) | 135 #if defined(ENABLE_EXTENSIONS) |
| 132 registry->RegisterBooleanPref( | 136 registry->RegisterBooleanPref( |
| 133 extensions::pref_names::kAlertsInitialized, | 137 extensions::pref_names::kAlertsInitialized, |
| 134 false, | 138 false, |
| 135 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 139 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 136 #endif | 140 #endif |
| 137 registry->RegisterStringPref( | 141 registry->RegisterStringPref( |
| 138 prefs::kSelectFileLastDirectory, | 142 prefs::kSelectFileLastDirectory, |
| 139 std::string(), | 143 std::string(), |
| 140 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 144 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 145 // TODO(wjmaclean): remove the following two prefs once migration to per- |
| 146 // partition zoom is complete. |
| 141 registry->RegisterDoublePref( | 147 registry->RegisterDoublePref( |
| 142 prefs::kDefaultZoomLevel, | 148 prefs::kDefaultZoomLevelDeprecated, |
| 143 0.0, | 149 0.0, |
| 144 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 150 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 145 registry->RegisterDictionaryPref( | 151 registry->RegisterDictionaryPref( |
| 146 prefs::kPerHostZoomLevels, | 152 prefs::kPerHostZoomLevelsDeprecated, |
| 153 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 154 |
| 155 registry->RegisterDictionaryPref( |
| 156 prefs::kPartitionDefaultZoomLevel, |
| 157 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 158 registry->RegisterDictionaryPref( |
| 159 prefs::kPartitionPerHostZoomLevels, |
| 147 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 160 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 148 registry->RegisterStringPref( | 161 registry->RegisterStringPref( |
| 149 prefs::kDefaultApps, | 162 prefs::kDefaultApps, |
| 150 "install", | 163 "install", |
| 151 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 164 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 152 registry->RegisterBooleanPref( | 165 registry->RegisterBooleanPref( |
| 153 prefs::kSpeechRecognitionFilterProfanities, | 166 prefs::kSpeechRecognitionFilterProfanities, |
| 154 true, | 167 true, |
| 155 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 168 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 156 registry->RegisterIntegerPref( | 169 registry->RegisterIntegerPref( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 content::NotificationService::NoDetails()); | 258 content::NotificationService::NoDetails()); |
| 246 } | 259 } |
| 247 } | 260 } |
| 248 | 261 |
| 249 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 262 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
| 250 DCHECK(a && b); | 263 DCHECK(a && b); |
| 251 if (a->IsSameProfile(b)) | 264 if (a->IsSameProfile(b)) |
| 252 return false; | 265 return false; |
| 253 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 266 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
| 254 } | 267 } |
| OLD | NEW |