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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // | 177 // |
178 // Can be called on any thread. | 178 // Can be called on any thread. |
179 virtual void DeleteDocument(const GURL& document_url, | 179 virtual void DeleteDocument(const GURL& document_url, |
180 const EntryActionCallback& callback) = 0; | 180 const EntryActionCallback& callback) = 0; |
181 | 181 |
182 // Downloads a document identified by its |content_url| in a given |format|. | 182 // Downloads a document identified by its |content_url| in a given |format|. |
183 // Upon completion, invokes |callback| with results on the calling thread. | 183 // Upon completion, invokes |callback| with results on the calling thread. |
184 // | 184 // |
185 // Can be called on any thread. | 185 // Can be called on any thread. |
186 virtual void DownloadDocument(const FilePath& virtual_path, | 186 virtual void DownloadDocument(const FilePath& virtual_path, |
| 187 const FilePath& local_cache_path, |
187 const GURL& content_url, | 188 const GURL& content_url, |
188 DocumentExportFormat format, | 189 DocumentExportFormat format, |
189 const DownloadActionCallback& callback) = 0; | 190 const DownloadActionCallback& callback) = 0; |
190 | 191 |
191 // Makes a copy of a document identified by its 'self' link |document_url|. | 192 // Makes a copy of a document identified by its 'self' link |document_url|. |
192 // The copy is named as the UTF-8 encoded |new_name| and is not added to any | 193 // The copy is named as the UTF-8 encoded |new_name| and is not added to any |
193 // collection. Use AddResourceToDirectory() to add the copy to a collection | 194 // collection. Use AddResourceToDirectory() to add the copy to a collection |
194 // when needed. Upon completion, invokes |callback| with results on the | 195 // when needed. Upon completion, invokes |callback| with results on the |
195 // calling thread. | 196 // calling thread. |
196 // | 197 // |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // Creates new collection with |directory_name| under parent directory | 234 // Creates new collection with |directory_name| under parent directory |
234 // identified with |parent_content_url|. If |parent_content_url| is empty, | 235 // identified with |parent_content_url|. If |parent_content_url| is empty, |
235 // the new collection will be created in the root. Upon completion, | 236 // the new collection will be created in the root. Upon completion, |
236 // invokes |callback| and passes newly created entry on the calling thread. | 237 // invokes |callback| and passes newly created entry on the calling thread. |
237 // | 238 // |
238 // Can be called on any thread. | 239 // Can be called on any thread. |
239 virtual void CreateDirectory(const GURL& parent_content_url, | 240 virtual void CreateDirectory(const GURL& parent_content_url, |
240 const FilePath::StringType& directory_name, | 241 const FilePath::StringType& directory_name, |
241 const GetDataCallback& callback) = 0; | 242 const GetDataCallback& callback) = 0; |
242 | 243 |
243 // Downloads a file identified by its |content_url|. Upon completion, invokes | 244 // Downloads a file identified by its |content_url|. The downloaded file will |
| 245 // be stored at |local_cache_path| location. Upon completion, invokes |
244 // |callback| with results on the calling thread. | 246 // |callback| with results on the calling thread. |
245 // | 247 // |
246 // Can be called on any thread. | 248 // Can be called on any thread. |
247 virtual void DownloadFile(const FilePath& virtual_path, | 249 virtual void DownloadFile(const FilePath& virtual_path, |
| 250 const FilePath& local_cache_path, |
248 const GURL& content_url, | 251 const GURL& content_url, |
249 const DownloadActionCallback& callback) = 0; | 252 const DownloadActionCallback& callback) = 0; |
250 | 253 |
251 // Initiates uploading of a document/file. | 254 // Initiates uploading of a document/file. |
252 // | 255 // |
253 // Can be called on any thread. | 256 // Can be called on any thread. |
254 virtual void InitiateUpload(const InitiateUploadParams& params, | 257 virtual void InitiateUpload(const InitiateUploadParams& params, |
255 const InitiateUploadCallback& callback) = 0; | 258 const InitiateUploadCallback& callback) = 0; |
256 | 259 |
257 // Resumes uploading of a document/file on the calling thread. | 260 // Resumes uploading of a document/file on the calling thread. |
(...skipping 17 matching lines...) Expand all Loading... |
275 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; | 278 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; |
276 virtual void CancelAll() OVERRIDE; | 279 virtual void CancelAll() OVERRIDE; |
277 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 280 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
278 virtual void GetDocuments(const GURL& feed_url, | 281 virtual void GetDocuments(const GURL& feed_url, |
279 const GetDataCallback& callback) OVERRIDE; | 282 const GetDataCallback& callback) OVERRIDE; |
280 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; | 283 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; |
281 virtual void DeleteDocument(const GURL& document_url, | 284 virtual void DeleteDocument(const GURL& document_url, |
282 const EntryActionCallback& callback) OVERRIDE; | 285 const EntryActionCallback& callback) OVERRIDE; |
283 virtual void DownloadDocument( | 286 virtual void DownloadDocument( |
284 const FilePath& virtual_path, | 287 const FilePath& virtual_path, |
| 288 const FilePath& local_cache_path, |
285 const GURL& content_url, | 289 const GURL& content_url, |
286 DocumentExportFormat format, | 290 DocumentExportFormat format, |
287 const DownloadActionCallback& callback) OVERRIDE; | 291 const DownloadActionCallback& callback) OVERRIDE; |
| 292 virtual void DownloadFile(const FilePath& virtual_path, |
| 293 const FilePath& local_cache_path, |
| 294 const GURL& content_url, |
| 295 const DownloadActionCallback& callback) OVERRIDE; |
288 virtual void CopyDocument(const GURL& document_url, | 296 virtual void CopyDocument(const GURL& document_url, |
289 const FilePath::StringType& new_name, | 297 const FilePath::StringType& new_name, |
290 const GetDataCallback& callback) OVERRIDE; | 298 const GetDataCallback& callback) OVERRIDE; |
291 virtual void RenameResource(const GURL& document_url, | 299 virtual void RenameResource(const GURL& document_url, |
292 const FilePath::StringType& new_name, | 300 const FilePath::StringType& new_name, |
293 const EntryActionCallback& callback) OVERRIDE; | 301 const EntryActionCallback& callback) OVERRIDE; |
294 virtual void AddResourceToDirectory( | 302 virtual void AddResourceToDirectory( |
295 const GURL& parent_content_url, | 303 const GURL& parent_content_url, |
296 const GURL& resource_url, | 304 const GURL& resource_url, |
297 const EntryActionCallback& callback) OVERRIDE; | 305 const EntryActionCallback& callback) OVERRIDE; |
298 virtual void RemoveResourceFromDirectory( | 306 virtual void RemoveResourceFromDirectory( |
299 const GURL& parent_content_url, | 307 const GURL& parent_content_url, |
300 const GURL& resource_url, | 308 const GURL& resource_url, |
301 const std::string& resource_id, | 309 const std::string& resource_id, |
302 const EntryActionCallback& callback) OVERRIDE; | 310 const EntryActionCallback& callback) OVERRIDE; |
303 virtual void CreateDirectory(const GURL& parent_content_url, | 311 virtual void CreateDirectory(const GURL& parent_content_url, |
304 const FilePath::StringType& directory_name, | 312 const FilePath::StringType& directory_name, |
305 const GetDataCallback& callback) OVERRIDE; | 313 const GetDataCallback& callback) OVERRIDE; |
306 virtual void DownloadFile(const FilePath& virtual_path, | |
307 const GURL& content_url, | |
308 const DownloadActionCallback& callback) OVERRIDE; | |
309 virtual void InitiateUpload(const InitiateUploadParams& params, | 314 virtual void InitiateUpload(const InitiateUploadParams& params, |
310 const InitiateUploadCallback& callback) OVERRIDE; | 315 const InitiateUploadCallback& callback) OVERRIDE; |
311 virtual void ResumeUpload(const ResumeUploadParams& params, | 316 virtual void ResumeUpload(const ResumeUploadParams& params, |
312 const ResumeUploadCallback& callback) OVERRIDE; | 317 const ResumeUploadCallback& callback) OVERRIDE; |
313 | 318 |
314 GDataAuthService* gdata_auth_service() { return gdata_auth_service_.get(); } | 319 GDataAuthService* gdata_auth_service() { return gdata_auth_service_.get(); } |
315 | 320 |
316 private: | 321 private: |
317 // GDataAuthService::Observer override. | 322 // GDataAuthService::Observer override. |
318 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; | 323 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; |
(...skipping 30 matching lines...) Expand all Loading... |
349 scoped_ptr<GDataOperationRegistry> operation_registry_; | 354 scoped_ptr<GDataOperationRegistry> operation_registry_; |
350 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; | 355 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; |
351 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; | 356 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; |
352 | 357 |
353 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 358 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
354 }; | 359 }; |
355 | 360 |
356 } // namespace gdata | 361 } // namespace gdata |
357 | 362 |
358 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ | 363 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ |
OLD | NEW |