| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/gdata/gdata.h" | 5 #include "chrome/browser/chromeos/gdata/gdata.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 | 190 |
| 191 void DocumentsService::Initialize(Profile* profile) { | 191 void DocumentsService::Initialize(Profile* profile) { |
| 192 profile_ = profile; | 192 profile_ = profile; |
| 193 // AddObserver() should be called before Initialize() as it could change | 193 // AddObserver() should be called before Initialize() as it could change |
| 194 // the refresh token. | 194 // the refresh token. |
| 195 gdata_auth_service_->AddObserver(this); | 195 gdata_auth_service_->AddObserver(this); |
| 196 gdata_auth_service_->Initialize(profile); | 196 gdata_auth_service_->Initialize(profile); |
| 197 } | 197 } |
| 198 | 198 |
| 199 GDataOperationRegistry* DocumentsService::operation_registry() const { |
| 200 return operation_registry_.get(); |
| 201 } |
| 202 |
| 199 void DocumentsService::CancelAll() { | 203 void DocumentsService::CancelAll() { |
| 200 operation_registry_->CancelAll(); | 204 operation_registry_->CancelAll(); |
| 201 } | 205 } |
| 202 | 206 |
| 203 void DocumentsService::Authenticate(const AuthStatusCallback& callback) { | 207 void DocumentsService::Authenticate(const AuthStatusCallback& callback) { |
| 204 gdata_auth_service_->StartAuthentication(operation_registry_.get(), | 208 gdata_auth_service_->StartAuthentication(operation_registry_.get(), |
| 205 callback); | 209 callback); |
| 206 } | 210 } |
| 207 | 211 |
| 208 void DocumentsService::GetDocuments(const GURL& url, | 212 void DocumentsService::GetDocuments(const GURL& url, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { | 377 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { |
| 374 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 378 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 375 | 379 |
| 376 gdata_auth_service_->ClearOAuth2Token(); | 380 gdata_auth_service_->ClearOAuth2Token(); |
| 377 // User authentication might have expired - rerun the request to force | 381 // User authentication might have expired - rerun the request to force |
| 378 // auth token refresh. | 382 // auth token refresh. |
| 379 StartOperation(operation); | 383 StartOperation(operation); |
| 380 } | 384 } |
| 381 | 385 |
| 382 } // namespace gdata | 386 } // namespace gdata |
| OLD | NEW |