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

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 fixes; use scoped_ptr; fix timer 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/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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698