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 namespace internal { | 14 namespace internal { |
15 | 15 |
16 namespace tray { | 16 namespace tray { |
17 class LogoutButton; | 17 class LogoutButton; |
18 } | 18 } |
19 | 19 |
20 // Adds a logout button to the system tray if enabled by the | 20 // Adds a logout button to the system tray if enabled by the |
21 // kShowLogoutButtonInTray pref. | 21 // kShowLogoutButtonInTray pref. |
22 class TrayLogoutButton : public SystemTrayItem, public LogoutButtonObserver { | 22 class TrayLogoutButton : public SystemTrayItem, public LogoutButtonObserver { |
23 public: | 23 public: |
24 TrayLogoutButton(); | 24 explicit TrayLogoutButton(SystemTray* system_tray); |
25 | 25 |
26 // Overridden from SystemTrayItem. | 26 // Overridden from SystemTrayItem. |
27 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 27 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
28 virtual void DestroyTrayView() OVERRIDE; | 28 virtual void DestroyTrayView() OVERRIDE; |
29 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 29 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
30 | 30 |
31 // Overridden from LogoutButtonObserver. | 31 // Overridden from LogoutButtonObserver. |
32 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; | 32 virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; |
33 | 33 |
34 private: | 34 private: |
35 tray::LogoutButton* logout_button_; | 35 tray::LogoutButton* logout_button_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(TrayLogoutButton); | 37 DISALLOW_COPY_AND_ASSIGN(TrayLogoutButton); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace internal | 40 } // namespace internal |
41 } // namespace ash | 41 } // namespace ash |
42 | 42 |
43 #endif // ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ | 43 #endif // ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_ |
OLD | NEW |