OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/time/time.h" | |
10 #include "base/timer/timer.h" | |
11 #include "ui/views/window/dialog_delegate.h" | |
12 | |
13 namespace views { | |
14 class Label; | |
15 } | |
16 | |
17 namespace ash { | |
18 | |
19 class LogoutConfirmationController; | |
20 | |
21 // A dialog that asks the user to confirm or deny logout. The dialog shows a | |
22 // countdown and informs the user that a logout will happen automatically if no | |
23 // choice is made before the countdown has expired. | |
24 class LogoutConfirmationDialog : public views::DialogDelegateView { | |
25 public: | |
26 LogoutConfirmationDialog(LogoutConfirmationController* controller, | |
27 base::TimeTicks logout_time); | |
28 ~LogoutConfirmationDialog() override; | |
29 | |
30 void Update(base::TimeTicks logout_time); | |
31 | |
32 // Called when |controller_| is no longer valid. | |
33 void ControllerGone(); | |
34 | |
35 // views::DialogDelegateView: | |
36 bool Accept() override; | |
37 ui::ModalType GetModalType() const override; | |
38 base::string16 GetWindowTitle() const override; | |
39 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
40 void WindowClosing() override; | |
41 | |
42 private: | |
43 void UpdateLabel(); | |
44 | |
45 LogoutConfirmationController* controller_; | |
46 base::TimeTicks logout_time_; | |
47 | |
48 views::Label* label_; | |
49 | |
50 base::RepeatingTimer update_timer_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialog); | |
53 }; | |
54 | |
55 } // namespace ash | |
56 | |
57 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
OLD | NEW |