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

Unified Diff: chrome/browser/chromeos/drive/drive_scheduler.cc

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/drive/drive_scheduler.cc
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc
index ece6c14bb515b7b666648ddc3c2c65864d473c66..4578e206f6b8671d0fef9ecd66674e061c89e29a 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler.cc
@@ -58,7 +58,7 @@ DriveScheduler::DriveScheduler(
DriveScheduler::~DriveScheduler() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(initialized_);
- net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void DriveScheduler::Initialize() {
@@ -69,7 +69,7 @@ void DriveScheduler::Initialize() {
if (initialized_)
return;
- net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
initialized_ = true;
}
@@ -605,14 +605,14 @@ void DriveScheduler::OnDownloadActionJobDone(int job_id,
job_info->download_action_callback.Run(error, temp_file);
}
-void DriveScheduler::OnConnectionTypeChanged(
+void DriveScheduler::OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Resume the job loop if the network is back online. Note that we don't
// need to check the type of the network as it will be checked in
// ShouldStopJobLoop() as soon as the loop is resumed.
- if (!net::NetworkChangeNotifier::IsOffline())
+ if (type != net::NetworkChangeNotifier::CONNECTION_NONE)
StartJobLoop();
}

Powered by Google App Engine
This is Rietveld 408576698