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); |
} |