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

Unified Diff: chrome/browser/ui/ash/session_state_delegate_chromeos.cc

Issue 83543004: cros: Use first unlock user's pref for locking screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: possible 0 unlock users Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/session_state_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
index ab465ddc4bdad979dc40e5bc6c36f6ecfb1e2141..3d8c3ac8826504c552d300ec111c41397decbb6a 100644
--- a/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/session_state_delegate_chromeos.cc
@@ -42,7 +42,10 @@ bool SessionStateDelegateChromeos::IsActiveUserSessionStarted() const {
}
bool SessionStateDelegateChromeos::CanLockScreen() const {
- return chromeos::UserManager::Get()->CanCurrentUserLock();
+ const chromeos::UserList unlock_users =
+ chromeos::UserManager::Get()->GetUnlockUsers();
+ DCHECK_LE(unlock_users.size(), 1u);
+ return !unlock_users.empty() && unlock_users[0]->can_lock();
}
bool SessionStateDelegateChromeos::IsScreenLocked() const {
@@ -51,7 +54,13 @@ bool SessionStateDelegateChromeos::IsScreenLocked() const {
}
bool SessionStateDelegateChromeos::ShouldLockScreenBeforeSuspending() const {
- Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
+ const chromeos::UserList unlock_users =
+ chromeos::UserManager::Get()->GetUnlockUsers();
+ DCHECK_LE(unlock_users.size(), 1u);
+ Profile* profile =
+ !unlock_users.empty()
+ ? chromeos::UserManager::Get()->GetProfileByUser(unlock_users[0])
+ : NULL;
return profile && profile->GetPrefs()->GetBoolean(prefs::kEnableScreenLock);
}

Powered by Google App Engine
This is Rietveld 408576698