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

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: 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
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2cb7858e5fb0d53f01d17ca547a757fb978ceb63 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();
Mr4D (OOO till 08-26) 2013/11/22 23:30:51 As long as there is at least one user, he should b
Daniel Erat 2013/11/22 23:39:41 my question was actually about whether it's possib
+ DCHECK_EQ(1u, unlock_users.size());
Daniel Erat 2013/11/22 23:14:47 is this _EQ correct, or should it be DCHECK_LE(unl
xiyuan 2013/11/22 23:46:13 Good catch. I did not realize this could be called
+ 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_EQ(1u, unlock_users.size());
Daniel Erat 2013/11/22 23:14:47 same question here
xiyuan 2013/11/22 23:46:13 Done.
+ Profile* profile =
+ !unlock_users.empty()
+ ? chromeos::UserManager::Get()->GetProfileByUser(unlock_users[0])
+ : NULL;
return profile && profile->GetPrefs()->GetBoolean(prefs::kEnableScreenLock);
}
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698