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 #include "ash/system/date/date_view.h" | 5 #include "ash/system/date/date_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void DateView::SetActionable(bool actionable) { | 127 void DateView::SetActionable(bool actionable) { |
128 actionable_ = actionable; | 128 actionable_ = actionable; |
129 set_focusable(actionable_); | 129 set_focusable(actionable_); |
130 } | 130 } |
131 | 131 |
132 void DateView::UpdateTextInternal(const base::Time& now) { | 132 void DateView::UpdateTextInternal(const base::Time& now) { |
133 date_label_->SetText(FormatDate(now)); | 133 date_label_->SetText(FormatDate(now)); |
134 day_of_week_label_->SetText(FormatDayOfWeek(now)); | 134 day_of_week_label_->SetText(FormatDayOfWeek(now)); |
135 } | 135 } |
136 | 136 |
137 bool DateView::PerformAction(const views::Event& event) { | 137 bool DateView::PerformAction(const ui::Event& event) { |
138 if (!actionable_) | 138 if (!actionable_) |
139 return false; | 139 return false; |
140 | 140 |
141 ash::Shell::GetInstance()->tray_delegate()->ShowDateSettings(); | 141 ash::Shell::GetInstance()->tray_delegate()->ShowDateSettings(); |
142 return true; | 142 return true; |
143 } | 143 } |
144 | 144 |
145 void DateView::OnMouseEntered(const views::MouseEvent& event) { | 145 void DateView::OnMouseEntered(const views::MouseEvent& event) { |
146 if (!actionable_) | 146 if (!actionable_) |
147 return; | 147 return; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 string16 minute = current_time.substr(colon_pos + 1); | 187 string16 minute = current_time.substr(colon_pos + 1); |
188 label_hour_left_->SetText(hour.substr(0, 1)); | 188 label_hour_left_->SetText(hour.substr(0, 1)); |
189 label_hour_right_->SetText(hour.length() == 2 ? | 189 label_hour_right_->SetText(hour.length() == 2 ? |
190 hour.substr(1,1) : ASCIIToUTF16(":")); | 190 hour.substr(1,1) : ASCIIToUTF16(":")); |
191 label_minute_left_->SetText(minute.substr(0, 1)); | 191 label_minute_left_->SetText(minute.substr(0, 1)); |
192 label_minute_right_->SetText(minute.substr(1, 1)); | 192 label_minute_right_->SetText(minute.substr(1, 1)); |
193 | 193 |
194 Layout(); | 194 Layout(); |
195 } | 195 } |
196 | 196 |
197 bool TimeView::PerformAction(const views::Event& event) { | 197 bool TimeView::PerformAction(const ui::Event& event) { |
198 return false; | 198 return false; |
199 } | 199 } |
200 | 200 |
201 bool TimeView::OnMousePressed(const views::MouseEvent& event) { | 201 bool TimeView::OnMousePressed(const views::MouseEvent& event) { |
202 // Let the event fall through. | 202 // Let the event fall through. |
203 return false; | 203 return false; |
204 } | 204 } |
205 | 205 |
206 void TimeView::UpdateClockLayout(TrayDate::ClockLayout clock_layout){ | 206 void TimeView::UpdateClockLayout(TrayDate::ClockLayout clock_layout){ |
207 SetBorder(clock_layout); | 207 SetBorder(clock_layout); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 void TimeView::SetupLabel(views::Label* label) { | 262 void TimeView::SetupLabel(views::Label* label) { |
263 label->set_owned_by_client(); | 263 label->set_owned_by_client(); |
264 SetupLabelForTray(label); | 264 SetupLabelForTray(label); |
265 gfx::Font font = label->font(); | 265 gfx::Font font = label->font(); |
266 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD)); | 266 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD)); |
267 } | 267 } |
268 | 268 |
269 } // namespace tray | 269 } // namespace tray |
270 } // namespace internal | 270 } // namespace internal |
271 } // namespace ash | 271 } // namespace ash |
OLD | NEW |