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

Unified Diff: ash/mus/system_tray_delegate_mus.cc

Issue 2373863002: mustash: Connect ash system tray "show settings" items to chrome over mojo (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
« no previous file with comments | « ash/mus/system_tray_delegate_mus.h ('k') | ash/public/interfaces/system_tray.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index f2afff5527e22ea33723c2f96543ae0273b0415b..6d390b7d76efc4de6101525e521e78d73adbe2c7 100644
--- a/ash/mus/system_tray_delegate_mus.cc
+++ b/ash/mus/system_tray_delegate_mus.cc
@@ -36,30 +36,97 @@ SystemTrayDelegateMus* SystemTrayDelegateMus::Get() {
return g_instance;
}
-void SystemTrayDelegateMus::ConnectToSystemTrayClient() {
- if (system_tray_client_.is_bound())
- return;
-
- connector_->ConnectToInterface("exe:chrome", &system_tray_client_);
-
- // Tolerate chrome crashing and coming back up.
- system_tray_client_.set_connection_error_handler(base::Bind(
- &SystemTrayDelegateMus::OnClientConnectionError, base::Unretained(this)));
+mojom::SystemTrayClient* SystemTrayDelegateMus::ConnectToSystemTrayClient() {
+ if (!system_tray_client_.is_bound()) {
+ // Connect (or reconnect) to the interface.
+ connector_->ConnectToInterface("exe:chrome", &system_tray_client_);
+
+ // Tolerate chrome crashing and coming back up.
+ system_tray_client_.set_connection_error_handler(
+ base::Bind(&SystemTrayDelegateMus::OnClientConnectionError,
+ base::Unretained(this)));
+ }
+ return system_tray_client_.get();
}
void SystemTrayDelegateMus::OnClientConnectionError() {
system_tray_client_.reset();
}
+////////////////////////////////////////////////////////////////////////////////
+// SystemTrayDelegate:
+
base::HourClockType SystemTrayDelegateMus::GetHourClockType() const {
return hour_clock_type_;
}
+void SystemTrayDelegateMus::ShowSettings() {
+ ConnectToSystemTrayClient()->ShowSettings();
+}
+
void SystemTrayDelegateMus::ShowDateSettings() {
- ConnectToSystemTrayClient();
- system_tray_client_->ShowDateSettings();
+ ConnectToSystemTrayClient()->ShowDateSettings();
+}
+
+void SystemTrayDelegateMus::ShowNetworkSettingsForGuid(
+ const std::string& guid) {
+ // http://crbug.com/647412
+ NOTIMPLEMENTED();
+}
+
+void SystemTrayDelegateMus::ShowDisplaySettings() {
+ ConnectToSystemTrayClient()->ShowDisplaySettings();
+}
+
+void SystemTrayDelegateMus::ShowPowerSettings() {
+ // http://crbug.com/647412
+ NOTIMPLEMENTED();
+}
+
+void SystemTrayDelegateMus::ShowChromeSlow() {
+ ConnectToSystemTrayClient()->ShowChromeSlow();
+}
+
+void SystemTrayDelegateMus::ShowIMESettings() {
+ ConnectToSystemTrayClient()->ShowIMESettings();
+}
+
+void SystemTrayDelegateMus::ShowHelp() {
+ ConnectToSystemTrayClient()->ShowHelp();
+}
+
+void SystemTrayDelegateMus::ShowAccessibilityHelp() {
+ ConnectToSystemTrayClient()->ShowAccessibilityHelp();
+}
+
+void SystemTrayDelegateMus::ShowAccessibilitySettings() {
+ ConnectToSystemTrayClient()->ShowAccessibilitySettings();
+}
+
+void SystemTrayDelegateMus::ShowPaletteHelp() {
+ ConnectToSystemTrayClient()->ShowPaletteHelp();
+}
+
+void SystemTrayDelegateMus::ShowPaletteSettings() {
+ ConnectToSystemTrayClient()->ShowPaletteSettings();
+}
+
+void SystemTrayDelegateMus::ShowPublicAccountInfo() {
+ ConnectToSystemTrayClient()->ShowPublicAccountInfo();
+}
+
+void SystemTrayDelegateMus::ShowEnterpriseInfo() {
+ // http://crbug.com/647412
+ NOTIMPLEMENTED();
+}
+
+void SystemTrayDelegateMus::ShowProxySettings() {
+ ConnectToSystemTrayClient()->ShowProxySettings();
}
+////////////////////////////////////////////////////////////////////////////////
+// mojom::SystemTray:
+
void SystemTrayDelegateMus::SetUse24HourClock(bool use_24_hour) {
hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock;
WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged();
« no previous file with comments | « ash/mus/system_tray_delegate_mus.h ('k') | ash/public/interfaces/system_tray.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698