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

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

Issue 2387253002: cros: Added policies for screen unlock. (Closed)
Patch Set: Fixed patch set 7 errors. Created 4 years, 1 month 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"
(...skipping 10 matching lines...) Expand all
21 #include "components/sync/base/sync_prefs.h" 21 #include "components/sync/base/sync_prefs.h"
22 #include "content/public/browser/host_zoom_map.h" 22 #include "content/public/browser/host_zoom_map.h"
23 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
24 #include "content/public/browser/notification_source.h" 24 #include "content/public/browser/notification_source.h"
25 #include "content/public/browser/storage_partition.h" 25 #include "content/public/browser/storage_partition.h"
26 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
27 #include "content/public/browser/web_ui.h" 27 #include "content/public/browser/web_ui.h"
28 28
29 #if defined(OS_CHROMEOS) 29 #if defined(OS_CHROMEOS)
30 #include "base/command_line.h" 30 #include "base/command_line.h"
31 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
31 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
32 #include "chromeos/chromeos_switches.h" 33 #include "chromeos/chromeos_switches.h"
33 #endif 34 #endif
34 35
35 #if defined(ENABLE_EXTENSIONS) 36 #if defined(ENABLE_EXTENSIONS)
36 #include "extensions/browser/pref_names.h" 37 #include "extensions/browser/pref_names.h"
37 #endif 38 #endif
38 39
39 Profile::Profile() 40 Profile::Profile()
40 : restored_last_session_(false), 41 : restored_last_session_(false),
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 166 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
166 #endif // defined(GOOGLE_CHROME_BUILD) 167 #endif // defined(GOOGLE_CHROME_BUILD)
167 registry->RegisterBooleanPref( 168 registry->RegisterBooleanPref(
168 prefs::kMediaRouterFirstRunFlowAcknowledged, 169 prefs::kMediaRouterFirstRunFlowAcknowledged,
169 false, 170 false,
170 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 171 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
171 #endif 172 #endif
172 173
173 #if defined(OS_CHROMEOS) 174 #if defined(OS_CHROMEOS)
174 registry->RegisterBooleanPref(prefs::kAllowScreenLock, true); 175 registry->RegisterBooleanPref(prefs::kAllowScreenLock, true);
176
177 base::ListValue screen_unlock_whitelist_default;
jdufault 2016/10/27 19:40:04 Is this the best location to register these prefs?
jdufault 2016/10/27 19:40:04 screen_unlock_whitelist_default => quick_unlock_de
sammiequon 2016/10/27 23:54:43 Done.
sammiequon 2016/10/27 23:54:43 Done.
178 screen_unlock_whitelist_default.AppendString("password");
jdufault 2016/10/27 19:40:04 Remove password
sammiequon 2016/10/27 23:54:43 Done.
179 registry->RegisterListPref(prefs::kQuickUnlockModeWhitelist,
180 screen_unlock_whitelist_default.DeepCopy());
181 registry->RegisterIntegerPref(
182 prefs::kQuickUnlockTimeout,
183 static_cast<int>(chromeos::PasswordConfirmationFrequency::DAY));
175 #endif 184 #endif
176 } 185 }
177 186
178 std::string Profile::GetDebugName() { 187 std::string Profile::GetDebugName() {
179 std::string name = GetPath().BaseName().MaybeAsASCII(); 188 std::string name = GetPath().BaseName().MaybeAsASCII();
180 if (name.empty()) { 189 if (name.empty()) {
181 name = "UnknownProfile"; 190 name = "UnknownProfile";
182 } 191 }
183 return name; 192 return name;
184 } 193 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (a->IsSameProfile(b)) 245 if (a->IsSameProfile(b))
237 return false; 246 return false;
238 return a->GetOriginalProfile() < b->GetOriginalProfile(); 247 return a->GetOriginalProfile() < b->GetOriginalProfile();
239 } 248 }
240 249
241 double Profile::GetDefaultZoomLevelForProfile() { 250 double Profile::GetDefaultZoomLevelForProfile() {
242 return GetDefaultStoragePartition(this) 251 return GetDefaultStoragePartition(this)
243 ->GetHostZoomMap() 252 ->GetHostZoomMap()
244 ->GetDefaultZoomLevel(); 253 ->GetDefaultZoomLevel();
245 } 254 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698