| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/network_connect_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/network_connect_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 10 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
| 11 #include "chrome/browser/chromeos/options/network_config_view.h" | |
| 12 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 11 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
| 13 #include "chrome/browser/ui/ash/system_tray_client.h" | 12 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 14 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 13 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 bool IsUIAvailable() { | 17 bool IsUIAvailable() { |
| 19 return ash::WmShell::HasInstance() && | 18 return ash::WmShell::HasInstance() && |
| 20 !ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked(); | 19 !ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 gfx::NativeWindow GetNativeWindow() { | 22 gfx::NativeWindow GetNativeWindow() { |
| 24 int container_id = SystemTrayClient::GetDialogParentContainerId(); | 23 int container_id = SystemTrayClient::GetDialogParentContainerId(); |
| 25 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 24 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 26 container_id); | 25 container_id); |
| 27 } | 26 } |
| 28 | 27 |
| 29 } // namespace | 28 } // namespace |
| 30 | 29 |
| 31 namespace chromeos { | 30 namespace chromeos { |
| 32 | 31 |
| 33 NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS() {} | 32 NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS() {} |
| 34 | 33 |
| 35 NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {} | 34 NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {} |
| 36 | 35 |
| 37 void NetworkConnectDelegateChromeOS::ShowNetworkConfigure( | 36 void NetworkConnectDelegateChromeOS::ShowNetworkConfigure( |
| 38 const std::string& network_id) { | 37 const std::string& network_id) { |
| 39 if (!IsUIAvailable()) | 38 if (!IsUIAvailable()) |
| 40 return; | 39 return; |
| 41 NetworkConfigView::ShowByNetworkId(network_id, GetNativeWindow()); | 40 SystemTrayClient::Get()->ShowNetworkConfigure(network_id); |
| 42 } | 41 } |
| 43 | 42 |
| 44 void NetworkConnectDelegateChromeOS::ShowNetworkSettings( | 43 void NetworkConnectDelegateChromeOS::ShowNetworkSettings( |
| 45 const std::string& network_id) { | 44 const std::string& network_id) { |
| 46 if (!IsUIAvailable()) | 45 if (!IsUIAvailable()) |
| 47 return; | 46 return; |
| 48 SystemTrayClient::Get()->ShowNetworkSettings(network_id); | 47 SystemTrayClient::Get()->ShowNetworkSettings(network_id); |
| 49 } | 48 } |
| 50 | 49 |
| 51 bool NetworkConnectDelegateChromeOS::ShowEnrollNetwork( | 50 bool NetworkConnectDelegateChromeOS::ShowEnrollNetwork( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 } | 62 } |
| 64 | 63 |
| 65 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog( | 64 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog( |
| 66 const std::string& network_id) { | 65 const std::string& network_id) { |
| 67 if (!IsUIAvailable()) | 66 if (!IsUIAvailable()) |
| 68 return; | 67 return; |
| 69 MobileSetupDialog::ShowByNetworkId(network_id); | 68 MobileSetupDialog::ShowByNetworkId(network_id); |
| 70 } | 69 } |
| 71 | 70 |
| 72 } // namespace chromeos | 71 } // namespace chromeos |
| OLD | NEW |