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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 | 129 |
130 DateView::~DateView() { | 130 DateView::~DateView() { |
131 } | 131 } |
132 | 132 |
133 void DateView::SetActionable(bool actionable) { | 133 void DateView::SetActionable(bool actionable) { |
134 actionable_ = actionable; | 134 actionable_ = actionable; |
135 set_focusable(actionable_); | 135 set_focusable(actionable_); |
136 } | 136 } |
137 | 137 |
138 void DateView::UpdateTextInternal(const base::Time& now) { | 138 void DateView::UpdateTextInternal(const base::Time& now) { |
139 SetAccessibleName( | |
140 base::TimeFormatFriendlyDate(now) + | |
141 ASCIIToUTF16(",") + | |
142 base::TimeFormatTimeOfDayWithHourClockType( | |
143 now, base::k12HourClock, base:: kKeepAmPm)); | |
Jun Mukai
2013/02/12 01:04:03
Is there some reason to be comma-separated rather
jennyz
2013/02/12 01:07:38
IDS_ASH_STATUS_TRAY_DATE has the week in short for
Jun Mukai
2013/02/12 01:15:05
ah, that makes sense. thanks!
| |
139 date_label_->SetText( | 144 date_label_->SetText( |
140 l10n_util::GetStringFUTF16( | 145 l10n_util::GetStringFUTF16( |
141 IDS_ASH_STATUS_TRAY_DATE, FormatDayOfWeek(now), FormatDate(now))); | 146 IDS_ASH_STATUS_TRAY_DATE, FormatDayOfWeek(now), FormatDate(now))); |
142 } | 147 } |
143 | 148 |
144 bool DateView::PerformAction(const ui::Event& event) { | 149 bool DateView::PerformAction(const ui::Event& event) { |
145 if (!actionable_) | 150 if (!actionable_) |
146 return false; | 151 return false; |
147 | 152 |
148 ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings(); | 153 ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 void TimeView::SetupLabel(views::Label* label) { | 281 void TimeView::SetupLabel(views::Label* label) { |
277 label->set_owned_by_client(); | 282 label->set_owned_by_client(); |
278 SetupLabelForTray(label); | 283 SetupLabelForTray(label); |
279 gfx::Font font = label->font(); | 284 gfx::Font font = label->font(); |
280 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD)); | 285 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD)); |
281 } | 286 } |
282 | 287 |
283 } // namespace tray | 288 } // namespace tray |
284 } // namespace internal | 289 } // namespace internal |
285 } // namespace ash | 290 } // namespace ash |
OLD | NEW |