| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // | 137 // |
| 138 // TODO(zel,benchan): Make the terminology/naming convention (e.g. file vs | 138 // TODO(zel,benchan): Make the terminology/naming convention (e.g. file vs |
| 139 // document vs resource, directory vs collection) more consistent and precise. | 139 // document vs resource, directory vs collection) more consistent and precise. |
| 140 class DocumentsServiceInterface { | 140 class DocumentsServiceInterface { |
| 141 public: | 141 public: |
| 142 virtual ~DocumentsServiceInterface() {} | 142 virtual ~DocumentsServiceInterface() {} |
| 143 | 143 |
| 144 // Initializes the documents service tied with |profile|. | 144 // Initializes the documents service tied with |profile|. |
| 145 virtual void Initialize(Profile* profile) = 0; | 145 virtual void Initialize(Profile* profile) = 0; |
| 146 | 146 |
| 147 // Retrieves the operation registry. | |
| 148 virtual GDataOperationRegistry* operation_registry() const = 0; | |
| 149 | |
| 150 // Cancels all in-flight operations. | 147 // Cancels all in-flight operations. |
| 151 virtual void CancelAll() = 0; | 148 virtual void CancelAll() = 0; |
| 152 | 149 |
| 153 // Authenticates the user by fetching the auth token as | 150 // Authenticates the user by fetching the auth token as |
| 154 // needed. |callback| will be run with the error code and the auth | 151 // needed. |callback| will be run with the error code and the auth |
| 155 // token, on the thread this function is run. | 152 // token, on the thread this function is run. |
| 156 // | 153 // |
| 157 // Can be called on any thread. | 154 // Can be called on any thread. |
| 158 virtual void Authenticate(const AuthStatusCallback& callback) = 0; | 155 virtual void Authenticate(const AuthStatusCallback& callback) = 0; |
| 159 | 156 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 class DocumentsService | 262 class DocumentsService |
| 266 : public DocumentsServiceInterface, | 263 : public DocumentsServiceInterface, |
| 267 public GDataAuthService::Observer { | 264 public GDataAuthService::Observer { |
| 268 public: | 265 public: |
| 269 // DocumentsService is usually owned and created by GDataFileSystem. | 266 // DocumentsService is usually owned and created by GDataFileSystem. |
| 270 DocumentsService(); | 267 DocumentsService(); |
| 271 virtual ~DocumentsService(); | 268 virtual ~DocumentsService(); |
| 272 | 269 |
| 273 // DocumentsServiceInterface Overrides | 270 // DocumentsServiceInterface Overrides |
| 274 virtual void Initialize(Profile* profile) OVERRIDE; | 271 virtual void Initialize(Profile* profile) OVERRIDE; |
| 275 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; | |
| 276 virtual void CancelAll() OVERRIDE; | 272 virtual void CancelAll() OVERRIDE; |
| 277 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 273 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
| 278 virtual void GetDocuments(const GURL& feed_url, | 274 virtual void GetDocuments(const GURL& feed_url, |
| 279 const GetDataCallback& callback) OVERRIDE; | 275 const GetDataCallback& callback) OVERRIDE; |
| 280 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; | 276 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; |
| 281 virtual void DeleteDocument(const GURL& document_url, | 277 virtual void DeleteDocument(const GURL& document_url, |
| 282 const EntryActionCallback& callback) OVERRIDE; | 278 const EntryActionCallback& callback) OVERRIDE; |
| 283 virtual void DownloadDocument( | 279 virtual void DownloadDocument( |
| 284 const FilePath& virtual_path, | 280 const FilePath& virtual_path, |
| 285 const GURL& content_url, | 281 const GURL& content_url, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 scoped_ptr<GDataOperationRegistry> operation_registry_; | 345 scoped_ptr<GDataOperationRegistry> operation_registry_; |
| 350 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; | 346 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; |
| 351 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; | 347 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; |
| 352 | 348 |
| 353 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 349 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
| 354 }; | 350 }; |
| 355 | 351 |
| 356 } // namespace gdata | 352 } // namespace gdata |
| 357 | 353 |
| 358 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ | 354 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_H_ |
| OLD | NEW |