Index: ash/system/chromeos/network/network_state_list_detailed_view.cc |
diff --git a/ash/system/chromeos/network/network_state_list_detailed_view.cc b/ash/system/chromeos/network/network_state_list_detailed_view.cc |
index b55bed558410a9e8c58b7853f8a8fa439a5e4d1a..a55e2a8a3ce56d898ebb9e34722d05c999dbd9cc 100644 |
--- a/ash/system/chromeos/network/network_state_list_detailed_view.cc |
+++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc |
@@ -40,9 +40,10 @@ |
#include "ui/views/widget/widget.h" |
using chromeos::DeviceState; |
+using chromeos::NetworkConnectionHandler; |
+using chromeos::NetworkHandler; |
using chromeos::NetworkState; |
using chromeos::NetworkStateHandler; |
-using chromeos::NetworkConnectionHandler; |
namespace ash { |
namespace internal { |
@@ -169,7 +170,7 @@ void NetworkStateListDetailedView::ManagerChanged() { |
void NetworkStateListDetailedView::NetworkListChanged() { |
NetworkStateList network_list; |
- NetworkStateHandler::Get()->GetNetworkList(&network_list); |
+ NetworkHandler::Get()->network_state_handler()->GetNetworkList(&network_list); |
UpdateNetworks(network_list); |
UpdateNetworkList(); |
UpdateHeaderButtons(); |
@@ -197,7 +198,7 @@ void NetworkStateListDetailedView::Init() { |
CreateHeaderButtons(); |
NetworkStateList network_list; |
- NetworkStateHandler::Get()->GetNetworkList(&network_list); |
+ NetworkHandler::Get()->network_state_handler()->GetNetworkList(&network_list); |
UpdateNetworks(network_list); |
UpdateNetworkList(); |
UpdateHeaderButtons(); |
@@ -222,7 +223,7 @@ void NetworkStateListDetailedView::ButtonPressed(views::Button* sender, |
// If the info bubble was visible, close it when some other item is clicked. |
ResetInfoBubble(); |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
ash::SystemTrayDelegate* delegate = |
ash::Shell::GetInstance()->system_tray_delegate(); |
if (sender == button_wifi_) { |
@@ -268,8 +269,8 @@ void NetworkStateListDetailedView::OnViewClicked(views::View* sender) { |
network_map_.find(sender); |
if (found != network_map_.end()) { |
const std::string& service_path = found->second; |
- const NetworkState* network = |
- NetworkStateHandler::Get()->GetNetworkState(service_path); |
+ const NetworkState* network = NetworkHandler::Get()-> |
+ network_state_handler()->GetNetworkState(service_path); |
if (!network || |
network->IsConnectedState() || network->IsConnectingState()) { |
Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( |
@@ -372,7 +373,7 @@ void NetworkStateListDetailedView::CreateNetworkExtra() { |
// Update UI components. |
void NetworkStateListDetailedView::UpdateHeaderButtons() { |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
if (button_wifi_) |
UpdateTechnologyButton(button_wifi_, flimflam::kTypeWifi); |
if (button_mobile_) { |
@@ -389,7 +390,8 @@ void NetworkStateListDetailedView::UpdateTechnologyButton( |
TrayPopupHeaderButton* button, |
const std::string& technology) { |
NetworkStateHandler::TechnologyState state = |
- NetworkStateHandler::Get()->GetTechnologyState(technology); |
+ NetworkHandler::Get()->network_state_handler()-> |
+ GetTechnologyState(technology); |
if (state == NetworkStateHandler::TECHNOLOGY_UNAVAILABLE) { |
button->SetVisible(false); |
return; |
@@ -427,7 +429,7 @@ void NetworkStateListDetailedView::UpdateNetworks( |
} |
void NetworkStateListDetailedView::UpdateNetworkList() { |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
// First, update state for all networks |
bool animating = false; |
@@ -546,7 +548,7 @@ bool NetworkStateListDetailedView::UpdateNetworkListEntries( |
std::set<std::string>* new_service_paths) { |
bool needs_relayout = false; |
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
// Insert child views |
int index = 0; |
@@ -635,7 +637,7 @@ void NetworkStateListDetailedView::UpdateNetworkExtra() { |
return; |
View* layout_parent = NULL; // All these buttons have the same parent. |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
if (other_wifi_) { |
DCHECK(turn_on_wifi_); |
NetworkStateHandler::TechnologyState state = |
@@ -717,7 +719,7 @@ bool NetworkStateListDetailedView::ResetInfoBubble() { |
views::View* NetworkStateListDetailedView::CreateNetworkInfoView() { |
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
std::string ip_address("0.0.0.0"); |
const NetworkState* network = handler->DefaultNetwork(); |
@@ -769,14 +771,14 @@ views::View* NetworkStateListDetailedView::CreateNetworkInfoView() { |
void NetworkStateListDetailedView::ConnectToNetwork( |
const std::string& service_path) { |
- const NetworkState* network = |
- NetworkStateHandler::Get()->GetNetworkState(service_path); |
+ const NetworkState* network = NetworkHandler::Get()->network_state_handler()-> |
+ GetNetworkState(service_path); |
if (!network) |
return; |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
chromeos::switches::kUseNewNetworkConfigurationHandlers)) { |
const bool ignore_error_state = false; |
- NetworkConnectionHandler::Get()->ConnectToNetwork( |
+ NetworkHandler::Get()->network_connection_handler()->ConnectToNetwork( |
service_path, |
base::Bind(&base::DoNothing), |
base::Bind(&NetworkStateListDetailedView::OnConnectFailed, |
@@ -812,7 +814,7 @@ void NetworkStateListDetailedView::OnConnectFailed( |
void NetworkStateListDetailedView::CallRequestScan() { |
VLOG(1) << "Requesting Network Scan."; |
- NetworkStateHandler::Get()->RequestScan(); |
+ NetworkHandler::Get()->network_state_handler()->RequestScan(); |
// Periodically request a scan while this UI is open. |
base::MessageLoopForUI::current()->PostDelayedTask( |
FROM_HERE, |
@@ -821,7 +823,7 @@ void NetworkStateListDetailedView::CallRequestScan() { |
} |
void NetworkStateListDetailedView::ToggleMobile() { |
- NetworkStateHandler* handler = NetworkStateHandler::Get(); |
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
bool enabled = |
handler->IsTechnologyEnabled(NetworkStateHandler::kMatchTypeMobile); |
if (enabled) { |