OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TRAY_LOGOUT_BUTTON_H_ | 5 #ifndef ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ |
6 #define ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ | 6 #define ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_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/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
| 14 |
| 15 class SystemTray; |
| 16 |
14 namespace internal { | 17 namespace internal { |
15 | 18 |
16 namespace tray { | 19 namespace tray { |
17 class LogoutButton; | 20 class LogoutButton; |
18 } | 21 } |
19 | 22 |
20 // Adds a logout button to the system tray if enabled by the | 23 // Adds a logout button to the system tray if enabled by the |
21 // kShowLogoutButtonInTray pref. | 24 // kShowLogoutButtonInTray pref. |
22 class TrayLogoutButton : public SystemTrayItem, public LogoutButtonObserver { | 25 class TrayLogoutButton : public SystemTrayItem, public LogoutButtonObserver { |
23 public: | 26 public: |
24 TrayLogoutButton(); | 27 explicit TrayLogoutButton(SystemTray* system_tray); |
25 | 28 |
26 // Overridden from SystemTrayItem. | 29 // Overridden from SystemTrayItem. |
27 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 30 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
28 virtual void DestroyTrayView() OVERRIDE; | 31 virtual void DestroyTrayView() OVERRIDE; |
29 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 32 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
30 | 33 |
31 // Overridden from LogoutButtonObserver. | 34 // Overridden from LogoutButtonObserver. |
32 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; | 35 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; |
33 | 36 |
34 private: | 37 private: |
35 tray::LogoutButton* logout_button_; | 38 tray::LogoutButton* logout_button_; |
36 | 39 |
37 DISALLOW_COPY_AND_ASSIGN(TrayLogoutButton); | 40 DISALLOW_COPY_AND_ASSIGN(TrayLogoutButton); |
38 }; | 41 }; |
39 | 42 |
40 } // namespace internal | 43 } // namespace internal |
41 } // namespace ash | 44 } // namespace ash |
42 | 45 |
43 #endif // ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ | 46 #endif // ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ |
OLD | NEW |