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

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: Add preference for dialog duration Created 7 years, 1 month 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 "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.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
21 namespace internal {
22
23 class LogoutButtonTray;
24
25 // This class implements dialog view for logout confirmation, supposed to be
bartfab (slow) 2013/10/28 16:24:07 I do not think the part "supposed to be used by lo
binjin 2013/10/29 16:07:05 Done.
26 // used by logout button tray directly.
27 class LogoutConfirmationDialogView : public views::DialogDelegateView {
28 public:
29 base::WeakPtr<LogoutConfirmationDialogView> GetWeakPtr();
bartfab (slow) 2013/10/28 16:24:07 SupportsWeakPtr provides this. But as commented el
binjin 2013/10/29 16:07:05 Done.
30
31 // views::DialogDelegateView:
32 virtual bool Accept() OVERRIDE;
33 virtual ui::ModalType GetModalType() const OVERRIDE;
34 virtual string16 GetWindowTitle() const OVERRIDE;
35 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
36
37 LogoutConfirmationDialogView();
bartfab (slow) 2013/10/28 16:24:07 The constructor and destructor should be the first
binjin 2013/10/29 16:07:05 Done.
38 virtual ~LogoutConfirmationDialogView();
39 void Show(base::TimeDelta duration);
40 void UpdateCountdown();
41
42 private:
43 views::Label* text_label_;
44
45 base::TimeTicks countdown_end_time_;
bartfab (slow) 2013/10/28 16:24:07 Instead of having to pass the time to the dialog a
binjin 2013/10/29 16:07:05 I think the current approach is fine. The life tim
46
47 base::RepeatingTimer<LogoutConfirmationDialogView> timer_;
48
49 base::WeakPtrFactory<LogoutConfirmationDialogView> weak_factory_;
50
51 DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialogView);
52 };
53
54 } // namespace internal
55
56 } // namespace ash
57
58 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_
59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698