| 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_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
| 6 #define ASH_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/time/time.h" | |
| 11 #include "base/timer/timer.h" | |
| 12 #include "ui/views/window/dialog_delegate.h" | |
| 13 | |
| 14 namespace views { | |
| 15 class Label; | |
| 16 } | |
| 17 | |
| 18 namespace ash { | |
| 19 | |
| 20 class LogoutConfirmationController; | |
| 21 | |
| 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 { | |
| 26 public: | |
| 27 LogoutConfirmationDialog(LogoutConfirmationController* controller, | |
| 28 base::TimeTicks logout_time); | |
| 29 ~LogoutConfirmationDialog() override; | |
| 30 | |
| 31 void Update(base::TimeTicks logout_time); | |
| 32 | |
| 33 // Called when |controller_| is no longer valid. | |
| 34 void ControllerGone(); | |
| 35 | |
| 36 // views::DialogDelegateView: | |
| 37 bool Accept() override; | |
| 38 ui::ModalType GetModalType() const override; | |
| 39 base::string16 GetWindowTitle() const override; | |
| 40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
| 41 void WindowClosing() override; | |
| 42 | |
| 43 private: | |
| 44 void UpdateLabel(); | |
| 45 | |
| 46 LogoutConfirmationController* controller_; | |
| 47 base::TimeTicks logout_time_; | |
| 48 | |
| 49 views::Label* label_; | |
| 50 | |
| 51 base::RepeatingTimer update_timer_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialog); | |
| 54 }; | |
| 55 | |
| 56 } // namespace ash | |
| 57 | |
| 58 #endif // ASH_SYSTEM_CHROMEOS_SESSION_LOGOUT_CONFIRMATION_DIALOG_H_ | |
| OLD | NEW |