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

Side by Side Diff: ash/mus/system_tray_delegate_mus.cc

Issue 2351893002: mash: Fix system tray clock 12/24 hour time setting (Closed)
Patch Set: review comments Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/mus/system_tray_delegate_mus.h"
6
7 #include "ash/common/system/tray/system_tray_notifier.h"
8 #include "ash/common/wm_shell.h"
9 #include "base/i18n/time_formatting.h"
10 #include "base/logging.h"
11
12 namespace ash {
13 namespace {
14
15 SystemTrayDelegateMus* g_instance = nullptr;
16
17 } // namespace
18
19 SystemTrayDelegateMus::SystemTrayDelegateMus()
20 : hour_clock_type_(base::GetHourClockType()) {
21 DCHECK(!g_instance);
22 g_instance = this;
23 }
24
25 SystemTrayDelegateMus::~SystemTrayDelegateMus() {
26 DCHECK_EQ(this, g_instance);
27 g_instance = nullptr;
28 }
29
30 // static
31 SystemTrayDelegateMus* SystemTrayDelegateMus::Get() {
32 return g_instance;
33 }
34
35 base::HourClockType SystemTrayDelegateMus::GetHourClockType() const {
36 return hour_clock_type_;
37 }
38
39 void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) {
40 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock;
41 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged();
42 }
43
44 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698