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

Unified Diff: chrome/browser/ui/ash/system_tray_client.cc

Issue 2360143004: mash: Add SystemTrayClient interface, use to show date settings (Closed)
Patch Set: tweaks, similarity 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_client.cc
diff --git a/chrome/browser/ui/ash/system_tray_controller_mus.cc b/chrome/browser/ui/ash/system_tray_client.cc
similarity index 62%
rename from chrome/browser/ui/ash/system_tray_controller_mus.cc
rename to chrome/browser/ui/ash/system_tray_client.cc
index 4fae245db722aa0caed2d463695a518605b72f55..740e006fdea6bef1b9deb0525fc60a5c9e305587 100644
--- a/chrome/browser/ui/ash/system_tray_controller_mus.cc
+++ b/chrome/browser/ui/ash/system_tray_client.cc
@@ -2,27 +2,36 @@
// 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/ui/ash/system_tray_client.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chromeos/system/system_clock.h"
+#include "chrome/browser/ui/ash/system_tray_common.h"
#include "content/public/common/mojo_shell_connection.h"
#include "services/shell/public/cpp/connector.h"
-SystemTrayControllerMus::SystemTrayControllerMus() {
+SystemTrayClient::SystemTrayClient() : binding_(this) {
+ // Connect to the mojo SystemTray service in ash.
shell::Connector* connector =
content::MojoShellConnection::GetForProcess()->GetConnector();
connector->ConnectToInterface("mojo:ash", &system_tray_);
+ // Register this object as the SystemTrayClient interface implementation.
+ system_tray_->SetClient(binding_.CreateInterfacePtrAndBind());
+
g_browser_process->platform_part()->GetSystemClock()->AddObserver(this);
}
-SystemTrayControllerMus::~SystemTrayControllerMus() {
+SystemTrayClient::~SystemTrayClient() {
g_browser_process->platform_part()->GetSystemClock()->RemoveObserver(this);
}
-void SystemTrayControllerMus::OnSystemClockChanged(
+void SystemTrayClient::ShowDateSettings() {
+ SystemTrayCommon::ShowDateSettings();
+}
+
+void SystemTrayClient::OnSystemClockChanged(
chromeos::system::SystemClock* clock) {
system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock());
}

Powered by Google App Engine
This is Rietveld 408576698