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

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
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));
25 27
26 const int kHorizontalSpacing = 10; 28 const int kHorizontalSpacing = 10;
27 const int kVerticalSpacing = 3; 29 const int kVerticalSpacing = 3;
28 SetBorder(views::Border::CreateEmptyBorder(kVerticalSpacing, 30 SetBorder(views::Border::CreateEmptyBorder(kVerticalSpacing,
29 kHorizontalSpacing, 31 kHorizontalSpacing,
30 kVerticalSpacing, 32 kVerticalSpacing,
31 kHorizontalSpacing)); 33 kHorizontalSpacing));
32 34
(...skipping 27 matching lines...) Expand all
60 } 62 }
61 63
62 void TimeView::UpdateText() { 64 void TimeView::UpdateText() {
63 base::Time now = base::Time::Now(); 65 base::Time now = base::Time::Now();
64 SetText(base::TimeFormatTimeOfDayWithHourClockType( 66 SetText(base::TimeFormatTimeOfDayWithHourClockType(
65 now, base::k12HourClock, base::kKeepAmPm)); 67 now, base::k12HourClock, base::kKeepAmPm));
66 SetTimer(now); 68 SetTimer(now);
67 } 69 }
68 70
69 } // namespace athena 71 } // namespace athena
OLDNEW
« athena/home/athena_start_page_view.cc ('K') | « athena/system/time_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698