Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/chromeos/net/network_connect_delegate_chromeos.cc

Issue 2434683003: Move NetworkStateNotifier and NetworkConnect from src/ui (Closed)
Patch Set: Fix virtuals Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chromeos/net/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/net/network_state_notifier.h"
11 #include "chrome/browser/chromeos/sim_dialog_delegate.h" 12 #include "chrome/browser/chromeos/sim_dialog_delegate.h"
12 #include "chrome/browser/ui/ash/system_tray_client.h" 13 #include "chrome/browser/ui/ash/system_tray_client.h"
13 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" 14 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
14 15
15 namespace { 16 namespace {
16 17
17 bool IsUIAvailable() { 18 bool IsUIAvailable() {
18 return ash::WmShell::HasInstance() && 19 return ash::WmShell::HasInstance() &&
19 !ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked(); 20 !ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked();
20 } 21 }
21 22
22 gfx::NativeWindow GetNativeWindow() { 23 gfx::NativeWindow GetNativeWindow() {
23 int container_id = SystemTrayClient::GetDialogParentContainerId(); 24 int container_id = SystemTrayClient::GetDialogParentContainerId();
24 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 25 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
25 container_id); 26 container_id);
26 } 27 }
27 28
28 } // namespace 29 } // namespace
29 30
30 namespace chromeos { 31 namespace chromeos {
31 32
32 NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS() {} 33 NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS()
34 : network_state_notifier_(new NetworkStateNotifier()) {}
33 35
34 NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {} 36 NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {}
35 37
36 void NetworkConnectDelegateChromeOS::ShowNetworkConfigure( 38 void NetworkConnectDelegateChromeOS::ShowNetworkConfigure(
37 const std::string& network_id) { 39 const std::string& network_id) {
38 if (!IsUIAvailable()) 40 if (!IsUIAvailable())
39 return; 41 return;
40 SystemTrayClient::Get()->ShowNetworkConfigure(network_id); 42 SystemTrayClient::Get()->ShowNetworkConfigure(network_id);
41 } 43 }
42 44
(...skipping 18 matching lines...) Expand all
61 SimDialogDelegate::SIM_DIALOG_UNLOCK); 63 SimDialogDelegate::SIM_DIALOG_UNLOCK);
62 } 64 }
63 65
64 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog( 66 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog(
65 const std::string& network_id) { 67 const std::string& network_id) {
66 if (!IsUIAvailable()) 68 if (!IsUIAvailable())
67 return; 69 return;
68 MobileSetupDialog::ShowByNetworkId(network_id); 70 MobileSetupDialog::ShowByNetworkId(network_id);
69 } 71 }
70 72
73 void NetworkConnectDelegateChromeOS::ShowNetworkConnectError(
74 const std::string& error_name,
75 const std::string& network_id) {
76 network_state_notifier_->ShowNetworkConnectError(error_name, network_id);
77 }
78
79 void NetworkConnectDelegateChromeOS::ShowMobileActivationError(
80 const std::string& network_id) {
81 network_state_notifier_->ShowMobileActivationError(network_id);
82 }
83
71 } // namespace chromeos 84 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/network_connect_delegate_chromeos.h ('k') | chrome/browser/chromeos/net/network_state_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698