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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // | 90 // |
91 // Can be called on any thread. | 91 // Can be called on any thread. |
92 virtual void DeleteDocument(const GURL& document_url, | 92 virtual void DeleteDocument(const GURL& document_url, |
93 const EntryActionCallback& callback) = 0; | 93 const EntryActionCallback& callback) = 0; |
94 | 94 |
95 // Downloads a document identified by its |content_url| in a given |format|. | 95 // Downloads a document identified by its |content_url| in a given |format|. |
96 // Upon completion, invokes |callback| with results on the calling thread. | 96 // Upon completion, invokes |callback| with results on the calling thread. |
97 // | 97 // |
98 // Can be called on any thread. | 98 // Can be called on any thread. |
99 virtual void DownloadDocument(const FilePath& virtual_path, | 99 virtual void DownloadDocument(const FilePath& virtual_path, |
| 100 const FilePath& local_cache_path, |
100 const GURL& content_url, | 101 const GURL& content_url, |
101 DocumentExportFormat format, | 102 DocumentExportFormat format, |
102 const DownloadActionCallback& callback) = 0; | 103 const DownloadActionCallback& callback) = 0; |
103 | 104 |
104 // Makes a copy of a document identified by its 'self' link |document_url|. | 105 // Makes a copy of a document identified by its 'self' link |document_url|. |
105 // The copy is named as the UTF-8 encoded |new_name| and is not added to any | 106 // The copy is named as the UTF-8 encoded |new_name| and is not added to any |
106 // collection. Use AddResourceToDirectory() to add the copy to a collection | 107 // collection. Use AddResourceToDirectory() to add the copy to a collection |
107 // when needed. Upon completion, invokes |callback| with results on the | 108 // when needed. Upon completion, invokes |callback| with results on the |
108 // calling thread. | 109 // calling thread. |
109 // | 110 // |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Creates new collection with |directory_name| under parent directory | 147 // Creates new collection with |directory_name| under parent directory |
147 // identified with |parent_content_url|. If |parent_content_url| is empty, | 148 // identified with |parent_content_url|. If |parent_content_url| is empty, |
148 // the new collection will be created in the root. Upon completion, | 149 // the new collection will be created in the root. Upon completion, |
149 // invokes |callback| and passes newly created entry on the calling thread. | 150 // invokes |callback| and passes newly created entry on the calling thread. |
150 // | 151 // |
151 // Can be called on any thread. | 152 // Can be called on any thread. |
152 virtual void CreateDirectory(const GURL& parent_content_url, | 153 virtual void CreateDirectory(const GURL& parent_content_url, |
153 const FilePath::StringType& directory_name, | 154 const FilePath::StringType& directory_name, |
154 const GetDataCallback& callback) = 0; | 155 const GetDataCallback& callback) = 0; |
155 | 156 |
156 // Downloads a file identified by its |content_url|. Upon completion, invokes | 157 // Downloads a file identified by its |content_url|. The downloaded file will |
| 158 // be stored at |local_cache_path| location. Upon completion, invokes |
157 // |callback| with results on the calling thread. | 159 // |callback| with results on the calling thread. |
158 // | 160 // |
159 // Can be called on any thread. | 161 // Can be called on any thread. |
160 virtual void DownloadFile(const FilePath& virtual_path, | 162 virtual void DownloadFile(const FilePath& virtual_path, |
| 163 const FilePath& local_cache_path, |
161 const GURL& content_url, | 164 const GURL& content_url, |
162 const DownloadActionCallback& callback) = 0; | 165 const DownloadActionCallback& callback) = 0; |
163 | 166 |
164 // Initiates uploading of a document/file. | 167 // Initiates uploading of a document/file. |
165 // | 168 // |
166 // Can be called on any thread. | 169 // Can be called on any thread. |
167 virtual void InitiateUpload(const InitiateUploadParams& params, | 170 virtual void InitiateUpload(const InitiateUploadParams& params, |
168 const InitiateUploadCallback& callback) = 0; | 171 const InitiateUploadCallback& callback) = 0; |
169 | 172 |
170 // Resumes uploading of a document/file on the calling thread. | 173 // Resumes uploading of a document/file on the calling thread. |
(...skipping 17 matching lines...) Expand all Loading... |
188 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; | 191 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; |
189 virtual void CancelAll() OVERRIDE; | 192 virtual void CancelAll() OVERRIDE; |
190 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 193 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
191 virtual void GetDocuments(const GURL& feed_url, | 194 virtual void GetDocuments(const GURL& feed_url, |
192 const GetDataCallback& callback) OVERRIDE; | 195 const GetDataCallback& callback) OVERRIDE; |
193 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; | 196 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; |
194 virtual void DeleteDocument(const GURL& document_url, | 197 virtual void DeleteDocument(const GURL& document_url, |
195 const EntryActionCallback& callback) OVERRIDE; | 198 const EntryActionCallback& callback) OVERRIDE; |
196 virtual void DownloadDocument( | 199 virtual void DownloadDocument( |
197 const FilePath& virtual_path, | 200 const FilePath& virtual_path, |
| 201 const FilePath& local_cache_path, |
198 const GURL& content_url, | 202 const GURL& content_url, |
199 DocumentExportFormat format, | 203 DocumentExportFormat format, |
200 const DownloadActionCallback& callback) OVERRIDE; | 204 const DownloadActionCallback& callback) OVERRIDE; |
| 205 virtual void DownloadFile(const FilePath& virtual_path, |
| 206 const FilePath& local_cache_path, |
| 207 const GURL& content_url, |
| 208 const DownloadActionCallback& callback) OVERRIDE; |
201 virtual void CopyDocument(const GURL& document_url, | 209 virtual void CopyDocument(const GURL& document_url, |
202 const FilePath::StringType& new_name, | 210 const FilePath::StringType& new_name, |
203 const GetDataCallback& callback) OVERRIDE; | 211 const GetDataCallback& callback) OVERRIDE; |
204 virtual void RenameResource(const GURL& document_url, | 212 virtual void RenameResource(const GURL& document_url, |
205 const FilePath::StringType& new_name, | 213 const FilePath::StringType& new_name, |
206 const EntryActionCallback& callback) OVERRIDE; | 214 const EntryActionCallback& callback) OVERRIDE; |
207 virtual void AddResourceToDirectory( | 215 virtual void AddResourceToDirectory( |
208 const GURL& parent_content_url, | 216 const GURL& parent_content_url, |
209 const GURL& resource_url, | 217 const GURL& resource_url, |
210 const EntryActionCallback& callback) OVERRIDE; | 218 const EntryActionCallback& callback) OVERRIDE; |
211 virtual void RemoveResourceFromDirectory( | 219 virtual void RemoveResourceFromDirectory( |
212 const GURL& parent_content_url, | 220 const GURL& parent_content_url, |
213 const GURL& resource_url, | 221 const GURL& resource_url, |
214 const std::string& resource_id, | 222 const std::string& resource_id, |
215 const EntryActionCallback& callback) OVERRIDE; | 223 const EntryActionCallback& callback) OVERRIDE; |
216 virtual void CreateDirectory(const GURL& parent_content_url, | 224 virtual void CreateDirectory(const GURL& parent_content_url, |
217 const FilePath::StringType& directory_name, | 225 const FilePath::StringType& directory_name, |
218 const GetDataCallback& callback) OVERRIDE; | 226 const GetDataCallback& callback) OVERRIDE; |
219 virtual void DownloadFile(const FilePath& virtual_path, | |
220 const GURL& content_url, | |
221 const DownloadActionCallback& callback) OVERRIDE; | |
222 virtual void InitiateUpload(const InitiateUploadParams& params, | 227 virtual void InitiateUpload(const InitiateUploadParams& params, |
223 const InitiateUploadCallback& callback) OVERRIDE; | 228 const InitiateUploadCallback& callback) OVERRIDE; |
224 virtual void ResumeUpload(const ResumeUploadParams& params, | 229 virtual void ResumeUpload(const ResumeUploadParams& params, |
225 const ResumeUploadCallback& callback) OVERRIDE; | 230 const ResumeUploadCallback& callback) OVERRIDE; |
226 | 231 |
227 GDataAuthService* gdata_auth_service() { return gdata_auth_service_.get(); } | 232 GDataAuthService* gdata_auth_service() { return gdata_auth_service_.get(); } |
228 | 233 |
229 private: | 234 private: |
230 // GDataAuthService::Observer override. | 235 // GDataAuthService::Observer override. |
231 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; | 236 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; |
(...skipping 30 matching lines...) Expand all Loading... |
262 scoped_ptr<GDataOperationRegistry> operation_registry_; | 267 scoped_ptr<GDataOperationRegistry> operation_registry_; |
263 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; | 268 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; |
264 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; | 269 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; |
265 | 270 |
266 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 271 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
267 }; | 272 }; |
268 | 273 |
269 } // namespace gdata | 274 } // namespace gdata |
270 | 275 |
271 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 276 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
OLD | NEW |