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

Unified Diff: chrome/browser/chromeos/net/network_portal_detector_impl.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/chromeos/net/network_portal_detector_impl.cc
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
index 64d203cfa81bf759e541b0701ceb666f6872616d..cbedb2599ae13cdad91dc74aee331d41e619530e 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -101,7 +101,7 @@ void NetworkPortalDetectorImpl::Init() {
DCHECK(CalledOnValidThread());
state_ = STATE_IDLE;
- NetworkStateHandler::Get()->AddObserver(this);
+ NetworkHandler::Get()->network_state_handler()->AddObserver(this);
}
void NetworkPortalDetectorImpl::Shutdown() {
@@ -113,8 +113,8 @@ void NetworkPortalDetectorImpl::Shutdown() {
captive_portal_detector_->Cancel();
captive_portal_detector_.reset();
observers_.Clear();
- if (NetworkStateHandler::IsInitialized())
- NetworkStateHandler::Get()->RemoveObserver(this);
+ if (NetworkHandler::IsInitialized())
+ NetworkHandler::Get()->network_state_handler()->RemoveObserver(this);
}
void NetworkPortalDetectorImpl::AddObserver(Observer* observer) {
@@ -129,7 +129,8 @@ void NetworkPortalDetectorImpl::AddAndFireObserver(Observer* observer) {
if (!observer)
return;
AddObserver(observer);
- const NetworkState* network = NetworkStateHandler::Get()->DefaultNetwork();
+ const NetworkState* network =
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
observer->OnPortalDetectionCompleted(network, GetCaptivePortalState(network));
}
@@ -156,7 +157,7 @@ void NetworkPortalDetectorImpl::Enable(bool start_detection) {
state_ = STATE_IDLE;
attempt_count_ = 0;
const NetworkState* default_network =
- NetworkStateHandler::Get()->DefaultNetwork();
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
if (!default_network)
return;
portal_state_map_.erase(default_network->path());
@@ -203,7 +204,7 @@ void NetworkPortalDetectorImpl::DisableLazyDetection() {
void NetworkPortalDetectorImpl::NetworkManagerChanged() {
DCHECK(CalledOnValidThread());
const NetworkState* default_network =
- NetworkStateHandler::Get()->DefaultNetwork();
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
if (!default_network) {
default_network_id_.clear();
return;
@@ -361,7 +362,7 @@ void NetworkPortalDetectorImpl::OnPortalDetectionCompleted(
detection_timeout_.Cancel();
const NetworkState* default_network =
- NetworkStateHandler::Get()->DefaultNetwork();
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
CaptivePortalState state;
state.response_code = results.response_code;
@@ -479,7 +480,8 @@ bool NetworkPortalDetectorImpl::DetectionTimeoutIsCancelledForTesting() const {
int NetworkPortalDetectorImpl::GetRequestTimeoutSec() const {
DCHECK_LE(0, attempt_count_);
- const NetworkState* network = NetworkStateHandler::Get()->DefaultNetwork();
+ const NetworkState* network =
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
if (!network)
return kBaseRequestTimeoutSec;
if (lazy_detection_enabled_)

Powered by Google App Engine
This is Rietveld 408576698