Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: ash/system/logout_button/logout_confirmation_dialog_view.h

Issue 40053002: Implements the dialog view for logout button tray in public sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drop weak pointer for owner Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « ash/system/logout_button/logout_button_tray_unittest.cc ('k') | ash/system/logout_button/logout_confirmation_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698