OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ | 5 #ifndef ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ |
6 #define ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ | 6 #define ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ |
7 | 7 |
8 #include "ash/system/logout_button/logout_button_observer.h" | 8 #include "ash/system/logout_button/logout_button_observer.h" |
9 #include "ash/system/tray/tray_background_view.h" | 9 #include "ash/system/tray/tray_background_view.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class LabelButton; | 16 class LabelButton; |
17 } | 17 } |
18 | 18 |
19 namespace ash { | 19 namespace ash { |
20 namespace internal { | 20 namespace internal { |
21 | 21 |
22 class StatusAreaWidget; | 22 class StatusAreaWidget; |
23 class LogoutConfirmationDialogView; | |
23 | 24 |
24 // Adds a logout button to the launcher's status area if enabled by the | 25 // Adds a logout button to the launcher's status area if enabled by the |
25 // kShowLogoutButtonInTray pref. | 26 // kShowLogoutButtonInTray pref. |
26 class LogoutButtonTray : public TrayBackgroundView, | 27 class LogoutButtonTray : public TrayBackgroundView, |
27 public LogoutButtonObserver, | 28 public LogoutButtonObserver, |
28 public views::ButtonListener { | 29 public views::ButtonListener { |
29 public: | 30 public: |
30 explicit LogoutButtonTray(StatusAreaWidget* status_area_widget); | 31 explicit LogoutButtonTray(StatusAreaWidget* status_area_widget); |
31 virtual ~LogoutButtonTray(); | 32 virtual ~LogoutButtonTray(); |
32 | 33 |
34 void ShowConfirmDialog(); | |
bartfab (slow)
2013/10/24 13:11:02
- Here and elsewhere: s/confirm/confirmation/
- Al
binjin
2013/10/25 13:03:10
They are supposed to be accessed by LogoutConfirma
| |
35 void CloseConfirmDialog(); | |
36 void RemoveConfirmDialogInstance(LogoutConfirmationDialogView *instance); | |
37 | |
33 // TrayBackgroundView: | 38 // TrayBackgroundView: |
34 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; | 39 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
35 virtual base::string16 GetAccessibleNameForTray() OVERRIDE; | 40 virtual base::string16 GetAccessibleNameForTray() OVERRIDE; |
36 virtual void HideBubbleWithView( | 41 virtual void HideBubbleWithView( |
37 const views::TrayBubbleView* bubble_view) OVERRIDE; | 42 const views::TrayBubbleView* bubble_view) OVERRIDE; |
38 virtual bool ClickedOutsideBubble() OVERRIDE; | 43 virtual bool ClickedOutsideBubble() OVERRIDE; |
39 | 44 |
40 // LogoutButtonObserver: | 45 // LogoutButtonObserver: |
41 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; | 46 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; |
42 | 47 |
43 // views::ButtonListener: | 48 // views::ButtonListener: |
44 virtual void ButtonPressed(views::Button* sender, | 49 virtual void ButtonPressed(views::Button* sender, |
45 const ui::Event& event) OVERRIDE; | 50 const ui::Event& event) OVERRIDE; |
46 | 51 |
47 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 52 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
48 | 53 |
49 private: | 54 private: |
50 void UpdateVisibility(); | 55 void UpdateVisibility(); |
51 | 56 |
52 views::LabelButton* button_; // Not owned. | 57 views::LabelButton* button_; // Not owned. |
53 user::LoginStatus login_status_; | 58 user::LoginStatus login_status_; |
54 bool show_logout_button_in_tray_; | 59 bool show_logout_button_in_tray_; |
55 | 60 |
61 LogoutConfirmationDialogView* confirm_dialog_; | |
bartfab (slow)
2013/10/24 13:11:02
As commented in logout_confirmation_dialog_view.cc
binjin
2013/10/25 13:03:10
Done.
| |
62 | |
56 DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); | 63 DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); |
57 }; | 64 }; |
58 | 65 |
59 } // namespace internal | 66 } // namespace internal |
60 } // namespace ash | 67 } // namespace ash |
61 | 68 |
62 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ | 69 #endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ |
OLD | NEW |