| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/wallpaper/wallpaper_controller.h" | 10 #include "ash/common/wallpaper/wallpaper_controller.h" |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 ScreenLocker::~ScreenLocker() { | 498 ScreenLocker::~ScreenLocker() { |
| 499 VLOG(1) << "Destroying ScreenLocker " << this; | 499 VLOG(1) << "Destroying ScreenLocker " << this; |
| 500 DCHECK(base::MessageLoopForUI::IsCurrent()); | 500 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 501 | 501 |
| 502 if (authenticator_.get()) | 502 if (authenticator_.get()) |
| 503 authenticator_->SetConsumer(NULL); | 503 authenticator_->SetConsumer(NULL); |
| 504 ClearErrors(); | 504 ClearErrors(); |
| 505 | 505 |
| 506 VLOG(1) << "Moving wallpaper to unlocked container"; | 506 VLOG(1) << "Moving wallpaper to unlocked container"; |
| 507 ash::WmShell::Get()->wallpaper_controller()->MoveToUnlockedContainer(); | 507 ash::Shell::GetInstance()->wallpaper_controller()->MoveToUnlockedContainer(); |
| 508 | 508 |
| 509 screen_locker_ = NULL; | 509 screen_locker_ = NULL; |
| 510 bool state = false; | 510 bool state = false; |
| 511 VLOG(1) << "Emitting SCREEN_LOCK_STATE_CHANGED with state=" << state; | 511 VLOG(1) << "Emitting SCREEN_LOCK_STATE_CHANGED with state=" << state; |
| 512 content::NotificationService::current()->Notify( | 512 content::NotificationService::current()->Notify( |
| 513 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 513 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 514 content::Source<ScreenLocker>(this), | 514 content::Source<ScreenLocker>(this), |
| 515 content::Details<bool>(&state)); | 515 content::Details<bool>(&state)); |
| 516 | 516 |
| 517 VLOG(1) << "Calling session manager's HandleLockScreenDismissed D-Bus method"; | 517 VLOG(1) << "Calling session manager's HandleLockScreenDismissed D-Bus method"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 531 } | 531 } |
| 532 | 532 |
| 533 void ScreenLocker::ScreenLockReady() { | 533 void ScreenLocker::ScreenLockReady() { |
| 534 locked_ = true; | 534 locked_ = true; |
| 535 base::TimeDelta delta = base::Time::Now() - start_time_; | 535 base::TimeDelta delta = base::Time::Now() - start_time_; |
| 536 VLOG(1) << "ScreenLocker " << this << " is ready after " | 536 VLOG(1) << "ScreenLocker " << this << " is ready after " |
| 537 << delta.InSecondsF() << " second(s)"; | 537 << delta.InSecondsF() << " second(s)"; |
| 538 UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta); | 538 UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta); |
| 539 | 539 |
| 540 VLOG(1) << "Moving wallpaper to locked container"; | 540 VLOG(1) << "Moving wallpaper to locked container"; |
| 541 ash::WmShell::Get()->wallpaper_controller()->MoveToLockedContainer(); | 541 ash::Shell::GetInstance()->wallpaper_controller()->MoveToLockedContainer(); |
| 542 | 542 |
| 543 bool state = true; | 543 bool state = true; |
| 544 VLOG(1) << "Emitting SCREEN_LOCK_STATE_CHANGED with state=" << state; | 544 VLOG(1) << "Emitting SCREEN_LOCK_STATE_CHANGED with state=" << state; |
| 545 content::NotificationService::current()->Notify( | 545 content::NotificationService::current()->Notify( |
| 546 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 546 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 547 content::Source<ScreenLocker>(this), | 547 content::Source<ScreenLocker>(this), |
| 548 content::Details<bool>(&state)); | 548 content::Details<bool>(&state)); |
| 549 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; | 549 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; |
| 550 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); | 550 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); |
| 551 | 551 |
| 552 session_manager::SessionManager::Get()->SetSessionState( | 552 session_manager::SessionManager::Get()->SetSessionState( |
| 553 session_manager::SessionState::LOCKED); | 553 session_manager::SessionState::LOCKED); |
| 554 | 554 |
| 555 input_method::InputMethodManager::Get() | 555 input_method::InputMethodManager::Get() |
| 556 ->GetActiveIMEState() | 556 ->GetActiveIMEState() |
| 557 ->EnableLockScreenLayouts(); | 557 ->EnableLockScreenLayouts(); |
| 558 } | 558 } |
| 559 | 559 |
| 560 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { | 560 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { |
| 561 for (user_manager::User* user : users_) { | 561 for (user_manager::User* user : users_) { |
| 562 if (user->GetAccountId() == account_id) | 562 if (user->GetAccountId() == account_id) |
| 563 return true; | 563 return true; |
| 564 } | 564 } |
| 565 return false; | 565 return false; |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace chromeos | 568 } // namespace chromeos |
| OLD | NEW |