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

Side by Side Diff: athena/system/time_view.cc

Issue 483033003: [Athena] Add status icons and system time to the centered home card (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « athena/system/time_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/system/time_view.h" 5 #include "athena/system/time_view.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/views/border.h" 9 #include "ui/views/border.h"
10 10
11 namespace athena { 11 namespace athena {
12 namespace { 12 namespace {
13 13
14 // Amount of slop to add into the timer to make sure we're into the next minute 14 // Amount of slop to add into the timer to make sure we're into the next minute
15 // when the timer goes off. 15 // when the timer goes off.
16 const int kTimerSlopSeconds = 1; 16 const int kTimerSlopSeconds = 1;
17 17
18 } // namespace 18 } // namespace
19 19
20 TimeView::TimeView() { 20 TimeView::TimeView(SystemUI::ColorScheme color_scheme) {
21 SetHorizontalAlignment(gfx::ALIGN_LEFT); 21 SetHorizontalAlignment(gfx::ALIGN_LEFT);
22 SetEnabledColor(SK_ColorWHITE); 22 SetEnabledColor((color_scheme == SystemUI::COLOR_SCHEME_LIGHT)
23 ? SK_ColorWHITE
24 : SK_ColorDKGRAY);
23 SetAutoColorReadabilityEnabled(false); 25 SetAutoColorReadabilityEnabled(false);
24 SetFontList(gfx::FontList().DeriveWithStyle(gfx::Font::BOLD)); 26 SetFontList(gfx::FontList().DeriveWithStyle(gfx::Font::BOLD));
27 SetSubpixelRenderingEnabled(false);
25 28
26 const int kHorizontalSpacing = 10; 29 const int kHorizontalSpacing = 10;
27 const int kVerticalSpacing = 3; 30 const int kVerticalSpacing = 3;
28 SetBorder(views::Border::CreateEmptyBorder(kVerticalSpacing, 31 SetBorder(views::Border::CreateEmptyBorder(kVerticalSpacing,
29 kHorizontalSpacing, 32 kHorizontalSpacing,
30 kVerticalSpacing, 33 kVerticalSpacing,
31 kHorizontalSpacing)); 34 kHorizontalSpacing));
32 35
33 UpdateText(); 36 UpdateText();
34 } 37 }
(...skipping 25 matching lines...) Expand all
60 } 63 }
61 64
62 void TimeView::UpdateText() { 65 void TimeView::UpdateText() {
63 base::Time now = base::Time::Now(); 66 base::Time now = base::Time::Now();
64 SetText(base::TimeFormatTimeOfDayWithHourClockType( 67 SetText(base::TimeFormatTimeOfDayWithHourClockType(
65 now, base::k12HourClock, base::kKeepAmPm)); 68 now, base::k12HourClock, base::kKeepAmPm));
66 SetTimer(now); 69 SetTimer(now);
67 } 70 }
68 71
69 } // namespace athena 72 } // namespace athena
OLDNEW
« no previous file with comments | « athena/system/time_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698