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

Unified Diff: chrome/browser/chromeos/drive/drive_sync_client.h

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_sync_client.h
diff --git a/chrome/browser/chromeos/drive/drive_sync_client.h b/chrome/browser/chromeos/drive/drive_sync_client.h
index aae1be33aa0dad1c30d533731091f69b8d185c42..d7be8efc35c8a2299aa99289aa87eb256ba47a7c 100644
--- a/chrome/browser/chromeos/drive/drive_sync_client.h
+++ b/chrome/browser/chromeos/drive/drive_sync_client.h
@@ -44,7 +44,7 @@ class DriveSyncClientObserver;
class DriveSyncClient
: public DriveFileSystemObserver,
public DriveCacheObserver,
- public net::NetworkChangeNotifier::ConnectionTypeObserver {
+ public net::NetworkChangeNotifier::NetworkChangeObserver {
public:
// Types of sync tasks.
enum SyncType {
@@ -114,8 +114,9 @@ class DriveSyncClient
delay_ = delay;
}
- // Starts the sync loop if it's not running.
- void StartSyncLoop();
+ // Starts the sync loop if it's not running. |force_offline| implies there
+ // is no usable network connection.
+ void StartSyncLoop(bool force_offline);
private:
friend class DriveSyncClientTest;
@@ -126,11 +127,13 @@ class DriveSyncClient
// Runs the sync loop that fetches/uploads files in |queue_|. One file is
// fetched/uploaded at a time, rather than in parallel. The loop ends when
- // the queue becomes empty.
- void DoSyncLoop();
+ // the queue becomes empty. |force_offline| implies there is no usable network
+ // connection.
+ void DoSyncLoop(bool force_offline);
- // Returns true if we should stop the sync loop.
- bool ShouldStopSyncLoop();
+ // Returns true if we should stop the sync loop. |force_offline| implies there
+ // is no usable network connection.
+ bool ShouldStopSyncLoop(bool force_offline);
// Called when the resource IDs of files in the backlog are obtained.
void OnGetResourceIdsOfBacklog(const std::vector<std::string>* to_fetch,
@@ -175,8 +178,8 @@ class DriveSyncClient
// Called on prefs changes.
void OnDriveSyncPreferenceChanged();
- // net::NetworkChangeNotifier::ConnectionTypeObserver override.
- virtual void OnConnectionTypeChanged(
+ // net::NetworkChangeNotifier::NetworkChangeObserver override.
+ virtual void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698