OLD | NEW |
---|---|
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/chromeos/login/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 break; | 88 break; |
89 } | 89 } |
90 | 90 |
91 default: | 91 default: |
92 NOTREACHED(); | 92 NOTREACHED(); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 virtual void LockScreen() OVERRIDE { | 96 virtual void LockScreen() OVERRIDE { |
97 VLOG(1) << "Received LockScreen D-Bus signal from session manager"; | 97 VLOG(1) << "Received LockScreen D-Bus signal from session manager"; |
98 if (session_started_) { | 98 if (session_started_ && |
99 chromeos::UserManager::Get()->CanCurrentUserLock()) { | |
Nikita (slow)
2013/01/09 12:55:35
I'm not sure that making logout in this case makes
| |
99 chromeos::ScreenLocker::Show(); | 100 chromeos::ScreenLocker::Show(); |
100 } else { | 101 } else { |
101 // If the user has not completed the sign in we will log them out. This | 102 // If the current user's session cannot be locked or the user has not |
102 // avoids complications with displaying the lock screen over the login | 103 // completed all sign-in steps yet, log out instead. The latter is done to |
103 // screen while remaining secure in the case that they walk away during | 104 // avoid complications with displaying the lock screen over the login |
104 // the signin steps. See crbug.com/112225 and crbug.com/110933. | 105 // screen while remaining secure in the case the user walks away during |
106 // the sign-in steps. See crbug.com/112225 and crbug.com/110933. | |
105 VLOG(1) << "Calling session manager's StopSession D-Bus method"; | 107 VLOG(1) << "Calling session manager's StopSession D-Bus method"; |
106 chromeos::DBusThreadManager::Get()-> | 108 chromeos::DBusThreadManager::Get()-> |
107 GetSessionManagerClient()->StopSession(); | 109 GetSessionManagerClient()->StopSession(); |
108 } | 110 } |
109 } | 111 } |
110 | 112 |
111 virtual void UnlockScreen() OVERRIDE { | 113 virtual void UnlockScreen() OVERRIDE { |
112 VLOG(1) << "Received UnlockScreen D-Bus signal from session manager"; | 114 VLOG(1) << "Received UnlockScreen D-Bus signal from session manager"; |
113 chromeos::ScreenLocker::Hide(); | 115 chromeos::ScreenLocker::Hide(); |
114 } | 116 } |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 content::Details<bool>(&state)); | 422 content::Details<bool>(&state)); |
421 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; | 423 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; |
422 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); | 424 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); |
423 } | 425 } |
424 | 426 |
425 content::WebUI* ScreenLocker::GetAssociatedWebUI() { | 427 content::WebUI* ScreenLocker::GetAssociatedWebUI() { |
426 return delegate_->GetAssociatedWebUI(); | 428 return delegate_->GetAssociatedWebUI(); |
427 } | 429 } |
428 | 430 |
429 } // namespace chromeos | 431 } // namespace chromeos |
OLD | NEW |