Index: chrome/browser/ui/webui/chromeos/login/network_state_informer.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc b/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc |
index 555239d0cfcc7604261071f857ac002e691d75df..ecc89eac81db85bb6221ec862e096c0965c419d8 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc |
@@ -29,7 +29,8 @@ NetworkStateInformer::NetworkStateInformer() |
} |
NetworkStateInformer::~NetworkStateInformer() { |
- NetworkStateHandler::Get()->RemoveObserver(this); |
+ if (NetworkHandler::IsInitialized()) |
+ NetworkHandler::Get()->network_state_handler()->RemoveObserver(this); |
if (NetworkPortalDetector::IsEnabledInCommandLine() && |
NetworkPortalDetector::GetInstance()) { |
NetworkPortalDetector::GetInstance()->RemoveObserver(this); |
@@ -38,7 +39,7 @@ NetworkStateInformer::~NetworkStateInformer() { |
void NetworkStateInformer::Init() { |
UpdateState(); |
- NetworkStateHandler::Get()->AddObserver(this); |
+ NetworkHandler::Get()->network_state_handler()->AddObserver(this); |
if (NetworkPortalDetector::IsEnabledInCommandLine() && |
NetworkPortalDetector::GetInstance()) { |
@@ -69,7 +70,7 @@ void NetworkStateInformer::RemoveObserver( |
void NetworkStateInformer::NetworkManagerChanged() { |
const NetworkState* default_network = |
- NetworkStateHandler::Get()->DefaultNetwork(); |
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); |
State new_state = OFFLINE; |
std::string new_network_service_path; |
if (default_network) { |
@@ -108,8 +109,9 @@ void NetworkStateInformer::DefaultNetworkChanged(const NetworkState* network) { |
void NetworkStateInformer::OnPortalDetectionCompleted( |
const NetworkState* network, |
const NetworkPortalDetector::CaptivePortalState& state) { |
- if (NetworkStateHandler::IsInitialized() && |
- NetworkStateHandler::Get()->DefaultNetwork() == network) |
+ if (NetworkHandler::IsInitialized() && |
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork() == |
+ network) |
NetworkManagerChanged(); |
} |
@@ -133,7 +135,7 @@ bool NetworkStateInformer::UpdateState() { |
State new_state = OFFLINE; |
const NetworkState* default_network = |
- NetworkStateHandler::Get()->DefaultNetwork(); |
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); |
if (default_network) { |
new_state = GetNetworkState(default_network); |
last_network_service_path_ = default_network->path(); |