This source file includes following definitions.
- OnLastWindowClosed
#include "ash/system/chromeos/session/last_window_closed_logout_reminder.h"
#include "ash/shell.h"
#include "ash/system/chromeos/session/logout_confirmation_controller.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/user/login_status.h"
#include "base/time/time.h"
namespace ash {
namespace {
const int kLogoutConfirmationDelayInSeconds = 20;
}
LastWindowClosedLogoutReminder::LastWindowClosedLogoutReminder() {
Shell::GetInstance()->system_tray_notifier()->AddLastWindowClosedObserver(
this);
}
LastWindowClosedLogoutReminder::~LastWindowClosedLogoutReminder() {
Shell::GetInstance()->system_tray_notifier()->RemoveLastWindowClosedObserver(
this);
}
void LastWindowClosedLogoutReminder::OnLastWindowClosed() {
if (Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus() !=
user::LOGGED_IN_PUBLIC) {
return;
}
Shell::GetInstance()->logout_confirmation_controller()->ConfirmLogout(
base::TimeTicks::Now() +
base::TimeDelta::FromSeconds(kLogoutConfirmationDelayInSeconds));
}
}