Chromium Code Reviews| 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 "ash/ash_export.h" | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/time/time.h" | |
| 12 #include "base/timer/timer.h" | |
| 13 #include "ui/views/window/dialog_delegate.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class Label; | |
| 17 } | |
| 18 | |
| 19 namespace ash { | |
| 20 namespace internal { | |
| 21 | |
| 22 class LogoutButtonTray; | |
| 23 | |
| 24 // This class implements dialog view for logout confirmation. | |
| 25 class ASH_EXPORT LogoutConfirmationDialogView | |
| 26 : public views::DialogDelegateView { | |
| 27 public: | |
| 28 // This class provide setting and interface for LogoutConfirmationDialogView. | |
|
bartfab (slow)
2013/12/12 15:16:40
Nit 1: s/provide/provides/
Nit 2: s/setting and in
binjin
2013/12/12 15:39:10
Done.
| |
| 29 // It's supposed to be overridden for testing purpose. | |
| 30 class ASH_EXPORT Delegate { | |
| 31 public: | |
| 32 Delegate(); | |
| 33 virtual ~Delegate(); | |
| 34 | |
| 35 virtual void LogoutCurrentUser(); | |
| 36 virtual base::TimeTicks GetCurrentTime(); | |
|
bartfab (slow)
2013/12/12 15:16:40
Nit: const.
binjin
2013/12/12 15:39:10
Done.
| |
| 37 virtual base::TimeDelta GetUpdateInterval(); | |
|
bartfab (slow)
2013/12/12 15:16:40
Nit: const.
binjin
2013/12/12 15:39:10
Done.
| |
| 38 | |
| 39 private: | |
| 40 DISALLOW_COPY_AND_ASSIGN(Delegate); | |
| 41 }; | |
| 42 | |
| 43 LogoutConfirmationDialogView(LogoutButtonTray* owner, Delegate* delegate); | |
| 44 virtual ~LogoutConfirmationDialogView(); | |
| 45 | |
| 46 // views::DialogDelegateView: | |
| 47 virtual void DeleteDelegate() OVERRIDE; | |
| 48 virtual bool Accept() OVERRIDE; | |
| 49 virtual ui::ModalType GetModalType() const OVERRIDE; | |
| 50 virtual string16 GetWindowTitle() const OVERRIDE; | |
| 51 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | |
| 52 virtual void OnClosed() OVERRIDE; | |
| 53 | |
| 54 void Show(base::TimeDelta duration); | |
| 55 void UpdateDialogDuration(base::TimeDelta duration); | |
| 56 void NullifyOwner(); | |
|
bartfab (slow)
2013/12/12 15:16:40
This method is unnecessary. The *only* code path t
binjin
2013/12/12 15:39:10
Done.
| |
| 57 | |
| 58 private: | |
| 59 void LogoutCurrentUser(); | |
| 60 void UpdateCountdown(); | |
| 61 | |
| 62 views::Label* text_label_; | |
| 63 | |
| 64 base::TimeTicks countdown_start_time_; | |
| 65 base::TimeDelta duration_; | |
| 66 | |
| 67 base::RepeatingTimer<LogoutConfirmationDialogView> timer_; | |
| 68 | |
| 69 LogoutButtonTray* owner_; | |
| 70 | |
| 71 Delegate* delegate_; | |
| 72 | |
| 73 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialogView); | |
| 74 }; | |
| 75 | |
| 76 } // namespace internal | |
| 77 } // namespace ash | |
| 78 | |
| 79 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ | |
| OLD | NEW |