| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/first_run/first_run.h" | 11 #include "chrome/browser/first_run/first_run.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/sync/profile_sync_service_factory.h" | 13 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 14 #include "chrome/common/features.h" | 14 #include "chrome/common/features.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "components/browser_sync/profile_sync_service.h" | 16 #include "components/browser_sync/profile_sync_service.h" |
| 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
| 18 #include "components/pref_registry/pref_registry_syncable.h" | 18 #include "components/pref_registry/pref_registry_syncable.h" |
| 19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
| 20 #include "components/sync/base/sync_prefs.h" | 20 #include "components/sync/base/sync_prefs.h" |
| 21 #include "content/public/browser/host_zoom_map.h" | 21 #include "content/public/browser/host_zoom_map.h" |
| 22 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 23 #include "content/public/browser/notification_source.h" | 23 #include "content/public/browser/notification_source.h" |
| 24 #include "content/public/browser/storage_partition.h" | 24 #include "content/public/browser/storage_partition.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/browser/web_ui.h" | 26 #include "content/public/browser/web_ui.h" |
| 27 | 27 |
| 28 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
| 30 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" |
| 30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 31 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
| 32 #endif | 33 #endif |
| 33 | 34 |
| 34 #if defined(ENABLE_EXTENSIONS) | 35 #if defined(ENABLE_EXTENSIONS) |
| 35 #include "extensions/browser/pref_names.h" | 36 #include "extensions/browser/pref_names.h" |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 Profile::Profile() | 39 Profile::Profile() |
| 39 : restored_last_session_(false), | 40 : restored_last_session_(false), |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 165 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 165 #endif // defined(GOOGLE_CHROME_BUILD) | 166 #endif // defined(GOOGLE_CHROME_BUILD) |
| 166 registry->RegisterBooleanPref( | 167 registry->RegisterBooleanPref( |
| 167 prefs::kMediaRouterFirstRunFlowAcknowledged, | 168 prefs::kMediaRouterFirstRunFlowAcknowledged, |
| 168 false, | 169 false, |
| 169 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 170 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 170 #endif | 171 #endif |
| 171 | 172 |
| 172 #if defined(OS_CHROMEOS) | 173 #if defined(OS_CHROMEOS) |
| 173 registry->RegisterBooleanPref(prefs::kAllowScreenLock, true); | 174 registry->RegisterBooleanPref(prefs::kAllowScreenLock, true); |
| 175 |
| 176 base::ListValue screen_unlock_whitelist_default; |
| 177 screen_unlock_whitelist_default.AppendString("password"); |
| 178 registry->RegisterListPref(prefs::kQuickUnlockModeWhitelist, |
| 179 screen_unlock_whitelist_default.DeepCopy()); |
| 180 registry->RegisterIntegerPref( |
| 181 prefs::kQuickUnlockTimeout, |
| 182 static_cast<int>(chromeos::PasswordConfirmationFrequency::DAY)); |
| 174 #endif | 183 #endif |
| 175 } | 184 } |
| 176 | 185 |
| 177 std::string Profile::GetDebugName() { | 186 std::string Profile::GetDebugName() { |
| 178 std::string name = GetPath().BaseName().MaybeAsASCII(); | 187 std::string name = GetPath().BaseName().MaybeAsASCII(); |
| 179 if (name.empty()) { | 188 if (name.empty()) { |
| 180 name = "UnknownProfile"; | 189 name = "UnknownProfile"; |
| 181 } | 190 } |
| 182 return name; | 191 return name; |
| 183 } | 192 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 if (a->IsSameProfile(b)) | 244 if (a->IsSameProfile(b)) |
| 236 return false; | 245 return false; |
| 237 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 246 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
| 238 } | 247 } |
| 239 | 248 |
| 240 double Profile::GetDefaultZoomLevelForProfile() { | 249 double Profile::GetDefaultZoomLevelForProfile() { |
| 241 return GetDefaultStoragePartition(this) | 250 return GetDefaultStoragePartition(this) |
| 242 ->GetHostZoomMap() | 251 ->GetHostZoomMap() |
| 243 ->GetDefaultZoomLevel(); | 252 ->GetDefaultZoomLevel(); |
| 244 } | 253 } |
| OLD | NEW |