| 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 "chrome/browser/ui/ash/system_tray_client.h" | 5 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 6 | 6 |
| 7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 content::RecordAction(base::UserMetricsAction("ShowPaletteOptions")); | 190 content::RecordAction(base::UserMetricsAction("ShowPaletteOptions")); |
| 191 ShowSettingsSubPageForActiveUser(kPaletteSettingsSubPageName); | 191 ShowSettingsSubPageForActiveUser(kPaletteSettingsSubPageName); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SystemTrayClient::ShowPublicAccountInfo() { | 194 void SystemTrayClient::ShowPublicAccountInfo() { |
| 195 chrome::ScopedTabbedBrowserDisplayer displayer( | 195 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 196 ProfileManager::GetActiveUserProfile()); | 196 ProfileManager::GetActiveUserProfile()); |
| 197 chrome::ShowPolicy(displayer.browser()); | 197 chrome::ShowPolicy(displayer.browser()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void SystemTrayClient::ShowNetworkConfigure(const std::string& service_path) { | 200 void SystemTrayClient::ShowNetworkConfigure(const std::string& network_id) { |
| 201 // TODO(jamescook): Consolidate this with the classic ash version from | 201 // TODO(jamescook): Consolidate this with the classic ash version from |
| 202 // NetworkConnectDelegateChromeOS. This will require moving the window | 202 // NetworkConnectDelegateChromeOS. This will require moving the window |
| 203 // container calculation to this class, then plumbing a container ID through | 203 // container calculation to this class, then plumbing a container ID through |
| 204 // the dialog code. | 204 // the dialog code. |
| 205 CHECK(chrome::IsRunningInMash()); | 205 CHECK(chrome::IsRunningInMash()); |
| 206 chromeos::NetworkConfigView::Show(service_path, nullptr /* parent */); | 206 chromeos::NetworkConfigView::ShowByNetworkId(network_id, |
| 207 nullptr /* parent */); |
| 207 } | 208 } |
| 208 | 209 |
| 209 void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) { | 210 void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) { |
| 210 if (!chrome::IsRunningInMash()) { | 211 if (!chrome::IsRunningInMash()) { |
| 211 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 | 212 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 |
| 212 if (!LoginState::Get()->IsUserLoggedIn() || | 213 if (!LoginState::Get()->IsUserLoggedIn() || |
| 213 ash::WmShell::Get() | 214 ash::WmShell::Get() |
| 214 ->GetSessionStateDelegate() | 215 ->GetSessionStateDelegate() |
| 215 ->IsInSecondaryLoginScreen()) | 216 ->IsInSecondaryLoginScreen()) |
| 216 return; | 217 return; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 connector->ConnectToInterface("service:content_browser", &system_tray_); | 255 connector->ConnectToInterface("service:content_browser", &system_tray_); |
| 255 | 256 |
| 256 // Tolerate ash crashing and coming back up. | 257 // Tolerate ash crashing and coming back up. |
| 257 system_tray_.set_connection_error_handler(base::Bind( | 258 system_tray_.set_connection_error_handler(base::Bind( |
| 258 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); | 259 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); |
| 259 } | 260 } |
| 260 | 261 |
| 261 void SystemTrayClient::OnClientConnectionError() { | 262 void SystemTrayClient::OnClientConnectionError() { |
| 262 system_tray_.reset(); | 263 system_tray_.reset(); |
| 263 } | 264 } |
| OLD | NEW |