| 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_DOCUMENTS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 ~GetDocumentsOptions(); | 75 ~GetDocumentsOptions(); |
| 76 | 76 |
| 77 int start_changestamp; | 77 int start_changestamp; |
| 78 std::string search_query; | 78 std::string search_query; |
| 79 std::string directory_resource_id; | 79 std::string directory_resource_id; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 virtual ~DocumentsServiceInterface() {} | 82 virtual ~DocumentsServiceInterface() {} |
| 83 | 83 |
| 84 // Initializes the documents service tied with |profile|. | 84 // Initializes the documents service tied with |profile|. |
| 85 virtual void Initialize(Profile* profile) = 0; | 85 virtual void Initialize(Profile* profile, bool use_drive_api) = 0; |
| 86 | 86 |
| 87 // Retrieves the operation registry. | 87 // Retrieves the operation registry. |
| 88 virtual GDataOperationRegistry* operation_registry() const = 0; | 88 virtual GDataOperationRegistry* operation_registry() const = 0; |
| 89 | 89 |
| 90 // Cancels all in-flight operations. | 90 // Cancels all in-flight operations. |
| 91 virtual void CancelAll() = 0; | 91 virtual void CancelAll() = 0; |
| 92 | 92 |
| 93 // Authenticates the user by fetching the auth token as | 93 // Authenticates the user by fetching the auth token as |
| 94 // needed. |callback| will be run with the error code and the auth | 94 // needed. |callback| will be run with the error code and the auth |
| 95 // token, on the thread this function is run. | 95 // token, on the thread this function is run. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // This class provides documents feed service calls. | 200 // This class provides documents feed service calls. |
| 201 class DocumentsService : public DocumentsServiceInterface { | 201 class DocumentsService : public DocumentsServiceInterface { |
| 202 public: | 202 public: |
| 203 // DocumentsService is usually owned and created by GDataFileSystem. | 203 // DocumentsService is usually owned and created by GDataFileSystem. |
| 204 DocumentsService(); | 204 DocumentsService(); |
| 205 virtual ~DocumentsService(); | 205 virtual ~DocumentsService(); |
| 206 | 206 |
| 207 GDataAuthService* auth_service_for_testing(); | 207 GDataAuthService* auth_service_for_testing(); |
| 208 | 208 |
| 209 // DocumentsServiceInterface Overrides | 209 // DocumentsServiceInterface Overrides |
| 210 virtual void Initialize(Profile* profile) OVERRIDE; | 210 virtual void Initialize(Profile* profile, bool use_drive_api) OVERRIDE; |
| 211 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; | 211 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; |
| 212 virtual void CancelAll() OVERRIDE; | 212 virtual void CancelAll() OVERRIDE; |
| 213 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 213 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
| 214 virtual void GetDocuments(const GURL& feed_url, | 214 virtual void GetDocuments(const GURL& feed_url, |
| 215 const GetDocumentsOptions& options, | 215 const GetDocumentsOptions& options, |
| 216 const GetDataCallback& callback) OVERRIDE; | 216 const GetDataCallback& callback) OVERRIDE; |
| 217 virtual void GetDocumentEntry(const std::string& resource_id, | 217 virtual void GetDocumentEntry(const std::string& resource_id, |
| 218 const GetDataCallback& callback) OVERRIDE; | 218 const GetDataCallback& callback) OVERRIDE; |
| 219 | 219 |
| 220 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; | 220 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 virtual void ResumeUpload(const ResumeUploadParams& params, | 255 virtual void ResumeUpload(const ResumeUploadParams& params, |
| 256 const ResumeUploadCallback& callback) OVERRIDE; | 256 const ResumeUploadCallback& callback) OVERRIDE; |
| 257 virtual void AuthorizeApp(const GURL& resource_url, | 257 virtual void AuthorizeApp(const GURL& resource_url, |
| 258 const std::string& app_id, | 258 const std::string& app_id, |
| 259 const GetDataCallback& callback) OVERRIDE; | 259 const GetDataCallback& callback) OVERRIDE; |
| 260 private: | 260 private: |
| 261 Profile* profile_; | 261 Profile* profile_; |
| 262 | 262 |
| 263 scoped_ptr<GDataOperationRunner> runner_; | 263 scoped_ptr<GDataOperationRunner> runner_; |
| 264 | 264 |
| 265 // If true use Drive v2 API instead of Document List API. |
| 266 bool use_drive_api_; |
| 267 |
| 265 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 268 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
| 266 }; | 269 }; |
| 267 | 270 |
| 268 } // namespace gdata | 271 } // namespace gdata |
| 269 | 272 |
| 270 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 273 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
| OLD | NEW |