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

Unified Diff: ash/system/chromeos/network/network_state_notifier.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: ash/system/chromeos/network/network_state_notifier.cc
diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ash/system/chromeos/network/network_state_notifier.cc
index e1cef84b3f2e71a1105d6ecdba7d10b424fcc149..26584485ea4ffe1107d7be32b352e086f192bd56 100644
--- a/ash/system/chromeos/network/network_state_notifier.cc
+++ b/ash/system/chromeos/network/network_state_notifier.cc
@@ -17,6 +17,7 @@
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/l10n/l10n_util.h"
+using chromeos::NetworkHandler;
using chromeos::NetworkState;
using chromeos::NetworkStateHandler;
@@ -107,15 +108,12 @@ namespace internal {
NetworkStateNotifier::NetworkStateNotifier()
: cellular_out_of_credits_(false) {
- if (!NetworkStateHandler::Get())
- return;
- NetworkStateHandler::Get()->AddObserver(this);
+ NetworkHandler::Get()->network_state_handler()->AddObserver(this);
InitializeNetworks();
}
NetworkStateNotifier::~NetworkStateNotifier() {
- if (NetworkStateHandler::Get())
- NetworkStateHandler::Get()->RemoveObserver(this);
+ NetworkHandler::Get()->network_state_handler()->RemoveObserver(this);
}
void NetworkStateNotifier::DefaultNetworkChanged(const NetworkState* network) {
@@ -130,7 +128,7 @@ void NetworkStateNotifier::DefaultNetworkChanged(const NetworkState* network) {
void NetworkStateNotifier::NetworkConnectionStateChanged(
const NetworkState* network) {
- NetworkStateHandler* handler = NetworkStateHandler::Get();
+ NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
std::string prev_state;
std::string new_state = network->connection_state();
CachedStateMap::iterator iter = cached_state_.find(network->path());
@@ -215,7 +213,7 @@ void NetworkStateNotifier::NotificationLinkClicked(
void NetworkStateNotifier::InitializeNetworks() {
NetworkStateList network_list;
- NetworkStateHandler::Get()->GetNetworkList(&network_list);
+ NetworkHandler::Get()->network_state_handler()->GetNetworkList(&network_list);
VLOG(1) << "NetworkStateNotifier:InitializeNetworks: "
<< network_list.size();
for (NetworkStateList::iterator iter = network_list.begin();
@@ -225,7 +223,7 @@ void NetworkStateNotifier::InitializeNetworks() {
cached_state_[network->path()] = network->connection_state();
}
const NetworkState* default_network =
- NetworkStateHandler::Get()->DefaultNetwork();
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
if (default_network && default_network->IsConnectedState())
last_active_network_ = default_network->path();
}

Powered by Google App Engine
This is Rietveld 408576698