| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 void SystemTrayClient::ShowNetworkConfigure(const std::string& network_id) { | 233 void SystemTrayClient::ShowNetworkConfigure(const std::string& network_id) { |
| 234 // UI is not available at the lock screen. | 234 // UI is not available at the lock screen. |
| 235 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 | 235 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 |
| 236 if (!chrome::IsRunningInMash() && | 236 if (!chrome::IsRunningInMash() && |
| 237 ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked()) { | 237 ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked()) { |
| 238 return; | 238 return; |
| 239 } | 239 } |
| 240 | 240 |
| 241 // Dialog will default to the primary display. | 241 // Dialog will default to the primary display. |
| 242 chromeos::NetworkConfigView::ShowInContainer(network_id, | 242 chromeos::NetworkConfigView::ShowForNetworkId(network_id, |
| 243 GetDialogParentContainerId()); | 243 nullptr /* parent */); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void SystemTrayClient::ShowNetworkCreate(const std::string& type) { | 246 void SystemTrayClient::ShowNetworkCreate(const std::string& type) { |
| 247 int container_id = GetDialogParentContainerId(); | 247 int container_id = GetDialogParentContainerId(); |
| 248 if (type == shill::kTypeCellular) { | 248 if (type == shill::kTypeCellular) { |
| 249 chromeos::ChooseMobileNetworkDialog::ShowDialogInContainer(container_id); | 249 chromeos::ChooseMobileNetworkDialog::ShowDialogInContainer(container_id); |
| 250 return; | 250 return; |
| 251 } | 251 } |
| 252 chromeos::NetworkConfigView::ShowForTypeInContainer(type, container_id); | 252 chromeos::NetworkConfigView::ShowForType(type, nullptr /* parent */); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) { | 255 void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) { |
| 256 if (!chrome::IsRunningInMash()) { | 256 if (!chrome::IsRunningInMash()) { |
| 257 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 | 257 // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964 |
| 258 if (!LoginState::Get()->IsUserLoggedIn() || | 258 if (!LoginState::Get()->IsUserLoggedIn() || |
| 259 ash::WmShell::Get() | 259 ash::WmShell::Get() |
| 260 ->GetSessionStateDelegate() | 260 ->GetSessionStateDelegate() |
| 261 ->IsInSecondaryLoginScreen()) | 261 ->IsInSecondaryLoginScreen()) |
| 262 return; | 262 return; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 connector->ConnectToInterface("service:content_browser", &system_tray_); | 300 connector->ConnectToInterface("service:content_browser", &system_tray_); |
| 301 | 301 |
| 302 // Tolerate ash crashing and coming back up. | 302 // Tolerate ash crashing and coming back up. |
| 303 system_tray_.set_connection_error_handler(base::Bind( | 303 system_tray_.set_connection_error_handler(base::Bind( |
| 304 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); | 304 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void SystemTrayClient::OnClientConnectionError() { | 307 void SystemTrayClient::OnClientConnectionError() { |
| 308 system_tray_.reset(); | 308 system_tray_.reset(); |
| 309 } | 309 } |
| OLD | NEW |