| 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();
|
|
|