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

Unified Diff: chrome/browser/ui/webui/chromeos/login/network_state_informer.cc

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos_unittests Created 7 years, 7 months 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 side-by-side diff with in-line comments
Download patch
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();
« no previous file with comments | « chrome/browser/ui/webui/chromeos/about_network.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698