| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/system/tray/system_tray_controller.h" | 5 #include "ash/common/system/tray/system_tray_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/system/tray/system_tray_notifier.h" | 7 #include "ash/common/system/tray/system_tray_notifier.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void SystemTrayController::ShowNetworkSettings(const std::string& network_id) { | 96 void SystemTrayController::ShowNetworkSettings(const std::string& network_id) { |
| 97 if (ConnectToSystemTrayClient()) | 97 if (ConnectToSystemTrayClient()) |
| 98 system_tray_client_->ShowNetworkSettings(network_id); | 98 system_tray_client_->ShowNetworkSettings(network_id); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void SystemTrayController::ShowProxySettings() { | 101 void SystemTrayController::ShowProxySettings() { |
| 102 if (ConnectToSystemTrayClient()) | 102 if (ConnectToSystemTrayClient()) |
| 103 system_tray_client_->ShowProxySettings(); | 103 system_tray_client_->ShowProxySettings(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void SystemTrayController::SignOut() { |
| 107 if (ConnectToSystemTrayClient()) |
| 108 system_tray_client_->SignOut(); |
| 109 } |
| 110 |
| 111 void SystemTrayController::RequestRestartForUpdate() { |
| 112 if (ConnectToSystemTrayClient()) |
| 113 system_tray_client_->RequestRestartForUpdate(); |
| 114 } |
| 115 |
| 106 void SystemTrayController::BindRequest(mojom::SystemTrayRequest request) { | 116 void SystemTrayController::BindRequest(mojom::SystemTrayRequest request) { |
| 107 bindings_.AddBinding(this, std::move(request)); | 117 bindings_.AddBinding(this, std::move(request)); |
| 108 } | 118 } |
| 109 | 119 |
| 110 bool SystemTrayController::ConnectToSystemTrayClient() { | 120 bool SystemTrayController::ConnectToSystemTrayClient() { |
| 111 // Unit tests may not have a connector. | 121 // Unit tests may not have a connector. |
| 112 if (!connector_) | 122 if (!connector_) |
| 113 return false; | 123 return false; |
| 114 | 124 |
| 115 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 135 void SystemTrayController::OnClientConnectionError() { | 145 void SystemTrayController::OnClientConnectionError() { |
| 136 system_tray_client_.reset(); | 146 system_tray_client_.reset(); |
| 137 } | 147 } |
| 138 | 148 |
| 139 void SystemTrayController::SetUse24HourClock(bool use_24_hour) { | 149 void SystemTrayController::SetUse24HourClock(bool use_24_hour) { |
| 140 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; | 150 hour_clock_type_ = use_24_hour ? base::k24HourClock : base::k12HourClock; |
| 141 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); | 151 WmShell::Get()->system_tray_notifier()->NotifyDateFormatChanged(); |
| 142 } | 152 } |
| 143 | 153 |
| 144 } // namespace ash | 154 } // namespace ash |
| OLD | NEW |