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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_client.h

Issue 11419281: DriveFileSyncService listens to OnNetworkConnected event to restart synchronization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/sync_file_system/drive_file_sync_client.h
diff --git a/chrome/browser/sync_file_system/drive_file_sync_client.h b/chrome/browser/sync_file_system/drive_file_sync_client.h
index 80b5619fe22eb49426d63658f7934fce7f749e70..c59c25b0be868bfe3312d3f3d7584597f41c7156 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_client.h
+++ b/chrome/browser/sync_file_system/drive_file_sync_client.h
@@ -16,6 +16,7 @@
#include "chrome/browser/google_apis/drive_upload_error.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
+#include "net/base/network_change_notifier.h"
class GURL;
class Profile;
@@ -31,6 +32,7 @@ class DriveFileSyncClientObserver {
DriveFileSyncClientObserver() {}
virtual ~DriveFileSyncClientObserver() {}
virtual void OnAuthenticated() = 0;
+ virtual void OnNetworkConnected() = 0;
private:
DISALLOW_COPY_AND_ASSIGN(DriveFileSyncClientObserver);
@@ -39,9 +41,11 @@ class DriveFileSyncClientObserver {
// This class is responsible for talking to the Drive service to get and put
// Drive directories, files and metadata.
// This class is owned by DriveFileSyncService.
-class DriveFileSyncClient : public google_apis::DriveServiceObserver,
- public base::NonThreadSafe,
- public base::SupportsWeakPtr<DriveFileSyncClient> {
+class DriveFileSyncClient
+ : public google_apis::DriveServiceObserver,
+ public net::NetworkChangeNotifier::ConnectionTypeObserver,
+ public base::NonThreadSafe,
+ public base::SupportsWeakPtr<DriveFileSyncClient> {
public:
typedef base::Callback<void(google_apis::GDataErrorCode error)>
GDataErrorCallback;
@@ -168,6 +172,10 @@ class DriveFileSyncClient : public google_apis::DriveServiceObserver,
// DriveServiceObserver overrides.
virtual void OnReadyToPerformOperations() OVERRIDE;
+ // ConnectionTypeObserver overrides.
+ virtual void OnConnectionTypeChanged(
+ net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
+
private:
friend class DriveFileSyncClientTest;
friend class DriveFileSyncServiceTest;

Powered by Google App Engine
This is Rietveld 408576698