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

Unified Diff: chrome/browser/ui/ash/system_tray_controller_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/system_tray_controller_mus.cc
diff --git a/chrome/browser/ui/ash/system_tray_controller_mus.cc b/chrome/browser/ui/ash/system_tray_controller_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4fae245db722aa0caed2d463695a518605b72f55
--- /dev/null
+++ b/chrome/browser/ui/ash/system_tray_controller_mus.cc
@@ -0,0 +1,28 @@
+// 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 "chrome/browser/ui/ash/system_tray_controller_mus.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/browser_process_platform_part.h"
+#include "chrome/browser/chromeos/system/system_clock.h"
+#include "content/public/common/mojo_shell_connection.h"
+#include "services/shell/public/cpp/connector.h"
+
+SystemTrayControllerMus::SystemTrayControllerMus() {
+ shell::Connector* connector =
+ content::MojoShellConnection::GetForProcess()->GetConnector();
+ connector->ConnectToInterface("mojo:ash", &system_tray_);
+
+ g_browser_process->platform_part()->GetSystemClock()->AddObserver(this);
+}
+
+SystemTrayControllerMus::~SystemTrayControllerMus() {
+ g_browser_process->platform_part()->GetSystemClock()->RemoveObserver(this);
+}
+
+void SystemTrayControllerMus::OnSystemClockChanged(
+ chromeos::system::SystemClock* clock) {
+ system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock());
+}

Powered by Google App Engine
This is Rietveld 408576698