| 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_documents_service.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_documents_service.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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 const DownloadActionCallback& callback) { | 167 const DownloadActionCallback& callback) { |
| 168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 169 | 169 |
| 170 DownloadFile( | 170 DownloadFile( |
| 171 virtual_path, | 171 virtual_path, |
| 172 local_cache_path, | 172 local_cache_path, |
| 173 chrome_common_net::AppendQueryParameter(document_url, | 173 chrome_common_net::AppendQueryParameter(document_url, |
| 174 "exportFormat", | 174 "exportFormat", |
| 175 GetExportFormatParam(format)), | 175 GetExportFormatParam(format)), |
| 176 callback, | 176 callback, |
| 177 GetDownloadDataCallback()); | 177 GetContentCallback()); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void DocumentsService::DownloadFile( | 180 void DocumentsService::DownloadFile( |
| 181 const FilePath& virtual_path, | 181 const FilePath& virtual_path, |
| 182 const FilePath& local_cache_path, | 182 const FilePath& local_cache_path, |
| 183 const GURL& document_url, | 183 const GURL& document_url, |
| 184 const DownloadActionCallback& download_action_callback, | 184 const DownloadActionCallback& download_action_callback, |
| 185 const GetDownloadDataCallback& get_download_data_callback) { | 185 const GetContentCallback& get_content_callback) { |
| 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 187 | 187 |
| 188 runner_->StartOperationWithRetry( | 188 runner_->StartOperationWithRetry( |
| 189 new DownloadFileOperation(operation_registry(), | 189 new DownloadFileOperation(operation_registry(), |
| 190 download_action_callback, | 190 download_action_callback, |
| 191 get_download_data_callback, document_url, | 191 get_content_callback, document_url, |
| 192 virtual_path, local_cache_path)); | 192 virtual_path, local_cache_path)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void DocumentsService::DeleteDocument(const GURL& document_url, | 195 void DocumentsService::DeleteDocument(const GURL& document_url, |
| 196 const EntryActionCallback& callback) { | 196 const EntryActionCallback& callback) { |
| 197 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 197 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 198 | 198 |
| 199 runner_->StartOperationWithRetry( | 199 runner_->StartOperationWithRetry( |
| 200 new DeleteDocumentOperation(operation_registry(), callback, | 200 new DeleteDocumentOperation(operation_registry(), callback, |
| 201 document_url)); | 201 document_url)); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 return runner_->auth_service()->HasAccessToken(); | 299 return runner_->auth_service()->HasAccessToken(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 bool DocumentsService::HasRefreshToken() const { | 302 bool DocumentsService::HasRefreshToken() const { |
| 303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 304 | 304 |
| 305 return runner_->auth_service()->HasRefreshToken(); | 305 return runner_->auth_service()->HasRefreshToken(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace gdata | 308 } // namespace gdata |
| OLD | NEW |