| 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 "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 if (UserManager::Get()->logged_in_user().email().empty()) { | 357 if (UserManager::Get()->logged_in_user().email().empty()) { |
| 358 DVLOG(1) << "Show: Refusing to lock screen for guest account."; | 358 DVLOG(1) << "Show: Refusing to lock screen for guest account."; |
| 359 return; | 359 return; |
| 360 } | 360 } |
| 361 | 361 |
| 362 // Exit fullscreen. | 362 // Exit fullscreen. |
| 363 Browser* browser = BrowserList::GetLastActive(); | 363 Browser* browser = BrowserList::GetLastActive(); |
| 364 // browser can be NULL if we receive a lock request before the first browser | 364 // browser can be NULL if we receive a lock request before the first browser |
| 365 // window is shown. | 365 // window is shown. |
| 366 if (browser && browser->window()->IsFullscreen()) { | 366 if (browser && browser->window()->IsFullscreen()) { |
| 367 browser->ToggleFullscreenMode(false); | 367 browser->ToggleFullscreenMode(); |
| 368 } | 368 } |
| 369 | 369 |
| 370 if (!screen_locker_) { | 370 if (!screen_locker_) { |
| 371 DVLOG(1) << "Show: Locking screen"; | 371 DVLOG(1) << "Show: Locking screen"; |
| 372 ScreenLocker* locker = | 372 ScreenLocker* locker = |
| 373 new ScreenLocker(UserManager::Get()->logged_in_user()); | 373 new ScreenLocker(UserManager::Get()->logged_in_user()); |
| 374 locker->Init(); | 374 locker->Init(); |
| 375 } else { | 375 } else { |
| 376 // PowerManager re-sends lock screen signal if it doesn't | 376 // PowerManager re-sends lock screen signal if it doesn't |
| 377 // receive the response within timeout. Just send complete | 377 // receive the response within timeout. Just send complete |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 bool state = true; | 444 bool state = true; |
| 445 content::NotificationService::current()->Notify( | 445 content::NotificationService::current()->Notify( |
| 446 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 446 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 447 content::Source<ScreenLocker>(this), | 447 content::Source<ScreenLocker>(this), |
| 448 content::Details<bool>(&state)); | 448 content::Details<bool>(&state)); |
| 449 DBusThreadManager::Get()->GetPowerManagerClient()-> | 449 DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 450 NotifyScreenLockCompleted(); | 450 NotifyScreenLockCompleted(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace chromeos | 453 } // namespace chromeos |
| OLD | NEW |