OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| 6 #define ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| 7 |
| 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" |
| 13 |
| 14 namespace views { |
| 15 class Label; |
| 16 } |
| 17 |
| 18 namespace ash { |
| 19 |
| 20 namespace internal { |
| 21 |
| 22 class LogoutButtonTray; |
| 23 |
| 24 // This class implements dialog view for logout confirmation. |
| 25 class LogoutConfirmationDialogView |
| 26 : public views::DialogDelegateView, |
| 27 public base::SupportsWeakPtr<LogoutConfirmationDialogView> { |
| 28 public: |
| 29 LogoutConfirmationDialogView(LogoutButtonTray* owner); |
| 30 virtual ~LogoutConfirmationDialogView(); |
| 31 |
| 32 // views::DialogDelegateView: |
| 33 virtual bool Accept() OVERRIDE; |
| 34 virtual ui::ModalType GetModalType() const OVERRIDE; |
| 35 virtual string16 GetWindowTitle() const OVERRIDE; |
| 36 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| 37 |
| 38 void Show(base::TimeDelta duration); |
| 39 void UpdateDialogDuration(base::TimeDelta duration); |
| 40 |
| 41 void ClearOwner(); |
| 42 |
| 43 private: |
| 44 void UpdateCountdown(); |
| 45 |
| 46 views::Label* text_label_; |
| 47 |
| 48 base::TimeTicks countdown_start_time_; |
| 49 base::TimeDelta duration_; |
| 50 |
| 51 base::RepeatingTimer<LogoutConfirmationDialogView> timer_; |
| 52 |
| 53 LogoutButtonTray* owner_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialogView); |
| 56 }; |
| 57 |
| 58 } // namespace internal |
| 59 |
| 60 } // namespace ash |
| 61 |
| 62 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| 63 |
OLD | NEW |