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_DATE_VIEW_H_ | 5 #ifndef ASH_SYSTEM_DATE_DATE_VIEW_H_ |
6 #define ASH_SYSTEM_DATE_DATE_VIEW_H_ | 6 #define ASH_SYSTEM_DATE_DATE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/system/date/tray_date.h" | 9 #include "ash/system/date/tray_date.h" |
10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 views::Label* day_of_week_label_; | 75 views::Label* day_of_week_label_; |
76 | 76 |
77 bool actionable_; | 77 bool actionable_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(DateView); | 79 DISALLOW_COPY_AND_ASSIGN(DateView); |
80 }; | 80 }; |
81 | 81 |
82 // Tray view used to display the current time. | 82 // Tray view used to display the current time. |
83 class TimeView : public BaseDateTimeView { | 83 class TimeView : public BaseDateTimeView { |
84 public: | 84 public: |
85 TimeView(); | 85 TimeView(TrayDate::ClockLayout clock_layout); |
86 virtual ~TimeView(); | 86 virtual ~TimeView(); |
87 | 87 |
88 views::Label* label() const { return label_.get(); } | 88 views::Label* label() const { return label_.get(); } |
89 views::Label* label_hour() const { return label_hour_.get(); } | 89 views::Label* label_hour_left() const { return label_hour_left_.get(); } |
90 views::Label* label_minute() const { return label_minute_.get(); } | 90 views::Label* label_hour_right() const { return label_hour_right_.get(); } |
| 91 views::Label* label_minute_left() const { return label_minute_left_.get(); } |
| 92 views::Label* label_minute_right() const { return label_minute_right_.get(); } |
91 | 93 |
92 // Updates the format of the displayed time. | 94 // Updates the format of the displayed time. |
93 void UpdateTimeFormat(); | 95 void UpdateTimeFormat(); |
94 | 96 |
95 // Updates clock layout. | 97 // Updates clock layout. |
96 void UpdateClockLayout(TrayDate::ClockLayout clock_layout); | 98 void UpdateClockLayout(TrayDate::ClockLayout clock_layout); |
97 | 99 |
98 private: | 100 private: |
99 // Overridden from BaseDateTimeView. | 101 // Overridden from BaseDateTimeView. |
100 virtual void UpdateTextInternal(const base::Time& now) OVERRIDE; | 102 virtual void UpdateTextInternal(const base::Time& now) OVERRIDE; |
101 | 103 |
102 // Overridden from ActionableView. | 104 // Overridden from ActionableView. |
103 virtual bool PerformAction(const views::Event& event) OVERRIDE; | 105 virtual bool PerformAction(const views::Event& event) OVERRIDE; |
104 | 106 |
105 // Overridden from views::View. | 107 // Overridden from views::View. |
106 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 108 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
107 | 109 |
108 void SetBorder(TrayDate::ClockLayout clock_layout); | 110 void SetBorder(TrayDate::ClockLayout clock_layout); |
| 111 void SetupLabels(); |
| 112 void SetupLabel(views::Label* label); |
109 | 113 |
110 scoped_ptr<views::Label> label_; | 114 scoped_ptr<views::Label> label_; |
111 scoped_ptr<views::Label> label_hour_; | 115 scoped_ptr<views::Label> label_hour_left_; |
112 scoped_ptr<views::Label> label_minute_; | 116 scoped_ptr<views::Label> label_hour_right_; |
| 117 scoped_ptr<views::Label> label_minute_left_; |
| 118 scoped_ptr<views::Label> label_minute_right_; |
113 | 119 |
114 base::HourClockType hour_type_; | 120 base::HourClockType hour_type_; |
115 | 121 |
116 DISALLOW_COPY_AND_ASSIGN(TimeView); | 122 DISALLOW_COPY_AND_ASSIGN(TimeView); |
117 }; | 123 }; |
118 | 124 |
119 } // namespace tray | 125 } // namespace tray |
120 } // namespace internal | 126 } // namespace internal |
121 } // namespace ash | 127 } // namespace ash |
122 | 128 |
123 #endif // ASH_SYSTEM_DATE_DATE_VIEW_H_ | 129 #endif // ASH_SYSTEM_DATE_DATE_VIEW_H_ |
OLD | NEW |