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_DATE_TRAY_DATE_H_ | 5 #ifndef ASH_SYSTEM_DATE_TRAY_DATE_H_ |
6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_ | 6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_ |
7 | 7 |
8 #include "ash/system/date/clock_observer.h" | 8 #include "ash/system/date/clock_observer.h" |
9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 class Label; | 12 class Label; |
13 } | 13 } |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
| 16 |
| 17 class SystemTray; |
| 18 |
16 namespace internal { | 19 namespace internal { |
17 | 20 |
18 namespace tray { | 21 namespace tray { |
19 class TimeView; | 22 class TimeView; |
20 } | 23 } |
21 | 24 |
22 class TrayDate : public SystemTrayItem, | 25 class TrayDate : public SystemTrayItem, |
23 public ClockObserver { | 26 public ClockObserver { |
24 public: | 27 public: |
25 enum ClockLayout { | 28 enum ClockLayout { |
26 HORIZONTAL_CLOCK, | 29 HORIZONTAL_CLOCK, |
27 VERTICAL_CLOCK, | 30 VERTICAL_CLOCK, |
28 }; | 31 }; |
29 TrayDate(); | 32 explicit TrayDate(SystemTray* system_tray); |
30 virtual ~TrayDate(); | 33 virtual ~TrayDate(); |
31 | 34 |
32 private: | 35 private: |
33 // Overridden from SystemTrayItem. | 36 // Overridden from SystemTrayItem. |
34 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 37 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
35 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 38 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
36 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 39 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
37 virtual void DestroyTrayView() OVERRIDE; | 40 virtual void DestroyTrayView() OVERRIDE; |
38 virtual void DestroyDefaultView() OVERRIDE; | 41 virtual void DestroyDefaultView() OVERRIDE; |
39 virtual void DestroyDetailedView() OVERRIDE; | 42 virtual void DestroyDetailedView() OVERRIDE; |
40 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 43 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
41 virtual void UpdateAfterShelfAlignmentChange( | 44 virtual void UpdateAfterShelfAlignmentChange( |
42 ShelfAlignment alignment) OVERRIDE; | 45 ShelfAlignment alignment) OVERRIDE; |
43 | 46 |
44 // Overridden from ClockObserver. | 47 // Overridden from ClockObserver. |
45 virtual void OnDateFormatChanged() OVERRIDE; | 48 virtual void OnDateFormatChanged() OVERRIDE; |
46 virtual void Refresh() OVERRIDE; | 49 virtual void Refresh() OVERRIDE; |
47 | 50 |
48 void SetupLabelForTimeTray(views::Label* label); | 51 void SetupLabelForTimeTray(views::Label* label); |
49 | 52 |
50 tray::TimeView* time_tray_; | 53 tray::TimeView* time_tray_; |
51 | 54 |
52 DISALLOW_COPY_AND_ASSIGN(TrayDate); | 55 DISALLOW_COPY_AND_ASSIGN(TrayDate); |
53 }; | 56 }; |
54 | 57 |
55 } // namespace internal | 58 } // namespace internal |
56 } // namespace ash | 59 } // namespace ash |
57 | 60 |
58 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_ | 61 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_ |
OLD | NEW |