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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_
6 #define ASH_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/time/time.h"
11 #include "base/timer/timer.h"
12 #include "ui/views/window/dialog_delegate.h"
20 class LogoutConfirmationController
;
22 // A dialog that asks the user to confirm or deny logout. The dialog shows a
23 // countdown and informs the user that a logout will happen automatically if no
24 // choice is made before the countdown has expired.
25 class LogoutConfirmationDialog
: public views::DialogDelegateView
{
27 LogoutConfirmationDialog(LogoutConfirmationController
* controller
,
28 base::TimeTicks logout_time
);
29 ~LogoutConfirmationDialog() override
;
31 void Update(base::TimeTicks logout_time
);
33 // views::DialogDelegateView:
34 bool Accept() override
;
35 ui::ModalType
GetModalType() const override
;
36 base::string16
GetWindowTitle() const override
;
37 base::string16
GetDialogButtonLabel(ui::DialogButton button
) const override
;
38 void OnClosed() override
;
39 void DeleteDelegate() override
;
44 LogoutConfirmationController
* controller_
;
45 base::TimeTicks logout_time_
;
49 base::RepeatingTimer
<LogoutConfirmationDialog
> update_timer_
;
51 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialog
);
56 #endif // ASH_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_