Index: chrome/browser/chromeos/gdata/gdata_wapi_service.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_wapi_service.cc b/chrome/browser/chromeos/gdata/gdata_wapi_service.cc |
index f031f49cc3ac58ef14bdc2a53b1ccc0c26603556..5d2165d6239749c1f9f23c578bee2fba05f4c97a 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_wapi_service.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_wapi_service.cc |
@@ -74,8 +74,10 @@ GDataWapiService::GDataWapiService() |
GDataWapiService::~GDataWapiService() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (runner_.get()) |
+ if (runner_.get()) { |
+ runner_->operation_registry()->RemoveObserver(this); |
runner_->auth_service()->RemoveObserver(this); |
+ } |
} |
AuthService* GDataWapiService::auth_service_for_testing() { |
@@ -96,6 +98,7 @@ void GDataWapiService::Initialize(Profile* profile) { |
runner_->Initialize(); |
runner_->auth_service()->AddObserver(this); |
+ runner_->operation_registry()->AddObserver(this); |
} |
void GDataWapiService::AddObserver(DriveServiceObserver* observer) { |
@@ -106,10 +109,6 @@ void GDataWapiService::RemoveObserver(DriveServiceObserver* observer) { |
observers_.RemoveObserver(observer); |
} |
-OperationRegistry* GDataWapiService::operation_registry() const { |
- return runner_->operation_registry(); |
-} |
- |
bool GDataWapiService::CanStartOperation() const { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -121,6 +120,16 @@ void GDataWapiService::CancelAll() { |
runner_->CancelAll(); |
} |
+bool GDataWapiService::CancelForFilePath(const FilePath& file_path) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ return operation_registry()->CancelForFilePath(file_path); |
+} |
+ |
+OperationProgressStatusList GDataWapiService::GetProgressStatusList() const { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ return operation_registry()->GetProgressStatusList(); |
+} |
+ |
void GDataWapiService::Authenticate(const AuthStatusCallback& callback) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
runner_->Authenticate(callback); |
@@ -314,6 +323,10 @@ bool GDataWapiService::HasRefreshToken() const { |
return runner_->auth_service()->HasRefreshToken(); |
} |
+OperationRegistry* GDataWapiService::operation_registry() const { |
+ return runner_->operation_registry(); |
+} |
+ |
void GDataWapiService::OnOAuth2RefreshTokenChanged() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
if (CanStartOperation()) { |
@@ -322,4 +335,17 @@ void GDataWapiService::OnOAuth2RefreshTokenChanged() { |
} |
} |
+void GDataWapiService::OnProgressUpdate( |
+ const OperationProgressStatusList& list) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ FOR_EACH_OBSERVER( |
+ DriveServiceObserver, observers_, OnProgressUpdate(list)); |
+} |
+ |
+void GDataWapiService::OnAuthenticationFailed() { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ FOR_EACH_OBSERVER( |
+ DriveServiceObserver, observers_, OnAuthenticationFailed()); |
+} |
+ |
} // namespace gdata |