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

Unified Diff: ash/mus/system_tray_delegate_mus.cc

Issue 2351893002: mash: Fix system tray clock 12/24 hour time setting (Closed)
Patch Set: tweak 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 side-by-side diff with in-line comments
Download patch
Index: ash/mus/system_tray_delegate_mus.cc
diff --git a/ash/mus/system_tray_delegate_mus.cc b/ash/mus/system_tray_delegate_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8911a3236da3940d50526270994de4831dcf8f6f
--- /dev/null
+++ b/ash/mus/system_tray_delegate_mus.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/mus/system_tray_delegate_mus.h"
+
+#include "ash/common/system/tray/system_tray_notifier.h"
+#include "ash/common/wm_shell.h"
+#include "base/i18n/time_formatting.h"
+
+namespace ash {
+
+SystemTrayDelegateMus::SystemTrayDelegateMus()
+ : hour_clock_type_(base::GetHourClockType()) {}
+
+SystemTrayDelegateMus::~SystemTrayDelegateMus() {}
+
+base::HourClockType SystemTrayDelegateMus::GetHourClockType() const {
+ return hour_clock_type_;
+}
+
+void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) {
+ hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock;
+ WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged();
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698