Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: ash/system/date/date_view.cc

Issue 2064953002: mash: Migrate tray date view to //ash/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trayviews
Patch Set: review feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/date/date_view.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/system/tray/system_tray_delegate.h" 7 #include "ash/common/system/tray/system_tray_delegate.h"
8 #include "ash/common/system/tray/tray_constants.h" 8 #include "ash/common/system/tray/tray_constants.h"
9 #include "ash/common/system/tray/tray_utils.h" 9 #include "ash/common/system/tray/tray_utils.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
11 #include "base/command_line.h"
12 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
13 #include "base/i18n/time_formatting.h" 12 #include "base/i18n/time_formatting.h"
14 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
15 #include "base/time/time.h" 14 #include "base/time/time.h"
16 #include "grit/ash_strings.h" 15 #include "grit/ash_strings.h"
17 #include "third_party/icu/source/i18n/unicode/datefmt.h" 16 #include "third_party/icu/source/i18n/unicode/datefmt.h"
18 #include "third_party/icu/source/i18n/unicode/dtptngen.h" 17 #include "third_party/icu/source/i18n/unicode/dtptngen.h"
19 #include "third_party/icu/source/i18n/unicode/smpdtfmt.h" 18 #include "third_party/icu/source/i18n/unicode/smpdtfmt.h"
20 #include "ui/accessibility/ax_view_state.h" 19 #include "ui/accessibility/ax_view_state.h"
21 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 136 }
138 137
139 void BaseDateTimeView::ChildPreferredSizeChanged(views::View* child) { 138 void BaseDateTimeView::ChildPreferredSizeChanged(views::View* child) {
140 PreferredSizeChanged(); 139 PreferredSizeChanged();
141 } 140 }
142 141
143 void BaseDateTimeView::OnLocaleChanged() { 142 void BaseDateTimeView::OnLocaleChanged() {
144 UpdateText(); 143 UpdateText();
145 } 144 }
146 145
146 ///////////////////////////////////////////////////////////////////////////////
147
147 DateView::DateView() : action_(TrayDate::NONE) { 148 DateView::DateView() : action_(TrayDate::NONE) {
148 SetLayoutManager( 149 SetLayoutManager(
149 new views::BoxLayout( 150 new views::BoxLayout(
150 views::BoxLayout::kVertical, 0, 0, 0)); 151 views::BoxLayout::kVertical, 0, 0, 0));
151 date_label_ = CreateLabel(); 152 date_label_ = CreateLabel();
152 date_label_->SetEnabledColor(kHeaderTextColorNormal); 153 date_label_->SetEnabledColor(kHeaderTextColorNormal);
153 UpdateTextInternal(base::Time::Now()); 154 UpdateTextInternal(base::Time::Now());
154 AddChildView(date_label_); 155 AddChildView(date_label_);
155 } 156 }
156 157
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 340 }
340 341
341 void TimeView::SetupLabel(views::Label* label) { 342 void TimeView::SetupLabel(views::Label* label) {
342 label->set_owned_by_client(); 343 label->set_owned_by_client();
343 SetupLabelForTray(label); 344 SetupLabelForTray(label);
344 label->SetElideBehavior(gfx::NO_ELIDE); 345 label->SetElideBehavior(gfx::NO_ELIDE);
345 } 346 }
346 347
347 } // namespace tray 348 } // namespace tray
348 } // namespace ash 349 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/date/date_view.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698