| 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 "ash/system/session/logout_confirmation_controller.h" | 5 #include "ash/system/session/logout_confirmation_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/login_status.h" | 9 #include "ash/login_status.h" |
| 10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/system/session/logout_confirmation_dialog.h" | 12 #include "ash/system/session/logout_confirmation_dialog.h" |
| 13 #include "ash/system/tray/system_tray_delegate.h" | |
| 14 #include "ash/system/tray/system_tray_notifier.h" | 13 #include "ash/system/tray/system_tray_notifier.h" |
| 15 #include "base/location.h" | 14 #include "base/location.h" |
| 16 #include "base/time/default_tick_clock.h" | 15 #include "base/time/default_tick_clock.h" |
| 17 #include "base/time/tick_clock.h" | 16 #include "base/time/tick_clock.h" |
| 18 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 19 | 18 |
| 20 namespace ash { | 19 namespace ash { |
| 21 namespace { | 20 namespace { |
| 22 const int kLogoutConfirmationDelayInSeconds = 20; | 21 const int kLogoutConfirmationDelayInSeconds = 20; |
| 23 } | 22 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 logout_closure_.Run(); | 83 logout_closure_.Run(); |
| 85 } | 84 } |
| 86 | 85 |
| 87 void LogoutConfirmationController::OnDialogClosed() { | 86 void LogoutConfirmationController::OnDialogClosed() { |
| 88 logout_time_ = base::TimeTicks(); | 87 logout_time_ = base::TimeTicks(); |
| 89 dialog_ = NULL; | 88 dialog_ = NULL; |
| 90 logout_timer_.Stop(); | 89 logout_timer_.Stop(); |
| 91 } | 90 } |
| 92 | 91 |
| 93 void LogoutConfirmationController::OnLastWindowClosed() { | 92 void LogoutConfirmationController::OnLastWindowClosed() { |
| 94 if (Shell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 93 if (Shell::Get()->session_controller()->login_status() != |
| 95 LoginStatus::PUBLIC) { | 94 LoginStatus::PUBLIC) { |
| 96 return; | 95 return; |
| 97 } | 96 } |
| 98 | 97 |
| 99 // Ask the user to confirm logout if a public session is in progress and the | 98 // Ask the user to confirm logout if a public session is in progress and the |
| 100 // screen is not locked. | 99 // screen is not locked. |
| 101 ConfirmLogout( | 100 ConfirmLogout( |
| 102 base::TimeTicks::Now() + | 101 base::TimeTicks::Now() + |
| 103 base::TimeDelta::FromSeconds(kLogoutConfirmationDelayInSeconds)); | 102 base::TimeDelta::FromSeconds(kLogoutConfirmationDelayInSeconds)); |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace ash | 105 } // namespace ash |
| OLD | NEW |