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

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: minor fix 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 class ASH_EXPORT Delegate {
29 public:
30 Delegate();
31 virtual ~Delegate();
32
33 virtual void LogoutCurrentUser();
34 virtual base::TimeTicks GetCurrentTime() const;
stevenjb 2013/12/18 21:55:20 Delegate methods should generally be pure virtuals
binjin 2013/12/19 16:30:39 Done. But constructor is needed for current approa
35
36 private:
37 DISALLOW_COPY_AND_ASSIGN(Delegate);
38 };
39
40 LogoutConfirmationDialogView(LogoutButtonTray* owner, Delegate* delegate);
41 virtual ~LogoutConfirmationDialogView();
42
43 // views::DialogDelegateView:
44 virtual bool Accept() OVERRIDE;
45 virtual ui::ModalType GetModalType() const OVERRIDE;
46 virtual string16 GetWindowTitle() const OVERRIDE;
47 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
48 virtual void OnClosed() OVERRIDE;
49 virtual void DeleteDelegate() OVERRIDE;
50
51 void Show(base::TimeDelta duration);
52
53 void UpdateDialogDuration(base::TimeDelta duration);
stevenjb 2013/12/18 21:55:20 Comment public methods.
binjin 2013/12/19 16:30:39 Done.
54
55 private:
56 void LogoutCurrentUser();
57 void UpdateCountdown();
58
59 views::Label* text_label_;
60
61 base::TimeTicks countdown_start_time_;
62 base::TimeDelta duration_;
63
64 base::RepeatingTimer<LogoutConfirmationDialogView> timer_;
65
66 LogoutButtonTray* owner_;
67
68 Delegate* delegate_;
69
70 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialogView);
71 };
72
73 } // namespace internal
74 } // namespace ash
75
76 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698