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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 11414253: DriveFileSyncService listens to OnAuthenticated event to recover from unavailable state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc
index 1ab7c8e6823a477dad3e6cf3bae1c89d11ad724a..0e01e8410335314b4fd766909862766946777a71 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc
@@ -13,7 +13,6 @@
#include "base/message_loop_proxy.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/google_apis/gdata_wapi_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync_file_system/drive_file_sync_client.h"
#include "chrome/browser/sync_file_system/drive_file_sync_util.h"
@@ -139,6 +138,7 @@ DriveFileSyncService::DriveFileSyncService(Profile* profile)
token_.reset(new TaskToken(AsWeakPtr()));
sync_client_.reset(new DriveFileSyncClient(profile));
+ sync_client_->AddObserver(this);
metadata_store_.reset(new DriveMetadataStore(
profile->GetPath(),
@@ -155,6 +155,7 @@ DriveFileSyncService::~DriveFileSyncService() {
// Invalidate WeakPtr instances here explicitly to notify TaskToken that we
// can safely discard the token.
weak_factory_.InvalidateWeakPtrs();
+ sync_client_->RemoveObserver(this);
token_.reset();
}
@@ -372,6 +373,12 @@ void DriveFileSyncService::ApplyLocalChange(
callback, fileapi::SYNC_STATUS_FAILED);
}
+void DriveFileSyncService::OnAuthenticated() {
+ FOR_EACH_OBSERVER(
+ Observer, observers_,
+ OnRemoteServiceStateUpdated(REMOTE_SERVICE_OK, "Authenticated"));
kinuko 2012/11/30 08:59:35 DriveFileSyncService is also keeping the current s
nhiroki 2012/11/30 09:08:58 Done.
+}
+
// Called by CreateForTesting.
DriveFileSyncService::DriveFileSyncService(
scoped_ptr<DriveFileSyncClient> sync_client,
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698