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

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

Issue 2387253002: cros: Added policies for screen unlock. (Closed)
Patch Set: Created 4 years, 2 months 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
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/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/driver/sync_prefs.h" 20 #include "components/sync/driver/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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
174 175
175 // Preferences related the lock screen pin unlock. 176 // Preferences related the lock screen pin unlock.
176 registry->RegisterIntegerPref(prefs::kPinUnlockMinimumLength, 4); 177 registry->RegisterIntegerPref(prefs::kPinUnlockMinimumLength, 4);
177 // 0 indicates no maximum length for the pin. 178 // 0 indicates no maximum length for the pin.
178 registry->RegisterIntegerPref(prefs::kPinUnlockMaximumLength, 0); 179 registry->RegisterIntegerPref(prefs::kPinUnlockMaximumLength, 0);
179 registry->RegisterBooleanPref(prefs::kPinUnlockAllowEasyPins, true); 180 registry->RegisterBooleanPref(prefs::kPinUnlockAllowEasyPins, true);
181
182 base::ListValue screen_unlock_whitelist_default;
183 screen_unlock_whitelist_default.AppendString("password");
184 registry->RegisterListPref(prefs::kScreenUnlockWhitelist,
185 screen_unlock_whitelist_default.DeepCopy());
186 registry->RegisterIntegerPref(
187 prefs::kScreenUnlockPasswordConfirmationFrequency,
188 static_cast<int>(chromeos::PasswordConfirmation::DAY));
jdufault 2016/10/04 23:26:21 int{}
sammiequon 2016/10/18 22:47:49 int{} will cause compiler error.
180 #endif 189 #endif
181 } 190 }
182 191
183 std::string Profile::GetDebugName() { 192 std::string Profile::GetDebugName() {
184 std::string name = GetPath().BaseName().MaybeAsASCII(); 193 std::string name = GetPath().BaseName().MaybeAsASCII();
185 if (name.empty()) { 194 if (name.empty()) {
186 name = "UnknownProfile"; 195 name = "UnknownProfile";
187 } 196 }
188 return name; 197 return name;
189 } 198 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (a->IsSameProfile(b)) 250 if (a->IsSameProfile(b))
242 return false; 251 return false;
243 return a->GetOriginalProfile() < b->GetOriginalProfile(); 252 return a->GetOriginalProfile() < b->GetOriginalProfile();
244 } 253 }
245 254
246 double Profile::GetDefaultZoomLevelForProfile() { 255 double Profile::GetDefaultZoomLevelForProfile() {
247 return GetDefaultStoragePartition(this) 256 return GetDefaultStoragePartition(this)
248 ->GetHostZoomMap() 257 ->GetHostZoomMap()
249 ->GetDefaultZoomLevel(); 258 ->GetDefaultZoomLevel();
250 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698