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" |
| 11 #include "chrome/browser/chromeos/gdata/drive_api_operations.h" |
11 #include "chrome/browser/chromeos/gdata/gdata_operation_runner.h" | 12 #include "chrome/browser/chromeos/gdata/gdata_operation_runner.h" |
12 #include "chrome/browser/chromeos/gdata/gdata_operations.h" | 13 #include "chrome/browser/chromeos/gdata/gdata_operations.h" |
| 14 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/net/url_util.h" | 16 #include "chrome/common/net/url_util.h" |
15 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
16 | 18 |
17 using content::BrowserThread; | 19 using content::BrowserThread; |
18 | 20 |
19 namespace gdata { | 21 namespace gdata { |
20 | 22 |
21 namespace { | 23 namespace { |
22 | 24 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { | 128 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { |
127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
128 | 130 |
129 GetAccountMetadataOperation* operation = | 131 GetAccountMetadataOperation* operation = |
130 new GetAccountMetadataOperation(operation_registry(), | 132 new GetAccountMetadataOperation(operation_registry(), |
131 profile_, | 133 profile_, |
132 callback); | 134 callback); |
133 runner_->StartOperationWithRetry(operation); | 135 runner_->StartOperationWithRetry(operation); |
134 } | 136 } |
135 | 137 |
| 138 void DocumentsService::GetAboutResource(const GetDataCallback& callback) { |
| 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 140 |
| 141 GetAboutOperation* operation = |
| 142 new GetAboutOperation(operation_registry(), profile_, callback); |
| 143 runner_->StartOperationWithRetry(operation); |
| 144 } |
| 145 |
| 146 void DocumentsService::GetApplicationList(const GetDataCallback& callback) { |
| 147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 148 |
| 149 GetApplistOperation* operation = |
| 150 new GetApplistOperation(operation_registry(), profile_, callback); |
| 151 runner_->StartOperationWithRetry(operation); |
| 152 } |
| 153 |
136 void DocumentsService::DownloadDocument( | 154 void DocumentsService::DownloadDocument( |
137 const FilePath& virtual_path, | 155 const FilePath& virtual_path, |
138 const FilePath& local_cache_path, | 156 const FilePath& local_cache_path, |
139 const GURL& document_url, | 157 const GURL& document_url, |
140 DocumentExportFormat format, | 158 DocumentExportFormat format, |
141 const DownloadActionCallback& callback) { | 159 const DownloadActionCallback& callback) { |
142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
143 | 161 |
144 DownloadFile( | 162 DownloadFile( |
145 virtual_path, | 163 virtual_path, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 return runner_->auth_service()->HasAccessToken(); | 295 return runner_->auth_service()->HasAccessToken(); |
278 } | 296 } |
279 | 297 |
280 bool DocumentsService::HasRefreshToken() const { | 298 bool DocumentsService::HasRefreshToken() const { |
281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 299 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
282 | 300 |
283 return runner_->auth_service()->HasRefreshToken(); | 301 return runner_->auth_service()->HasRefreshToken(); |
284 } | 302 } |
285 | 303 |
286 } // namespace gdata | 304 } // namespace gdata |
OLD | NEW |