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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/chromeos/gdata/gdata_operations.h" |
12 #include "chrome/browser/chromeos/gdata/gdata_auth_service.h" | 13 #include "chrome/browser/chromeos/gdata/gdata_auth_service.h" |
13 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 14 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
14 #include "chrome/browser/chromeos/gdata/gdata_params.h" | |
15 | 15 |
16 class FilePath; | 16 class FilePath; |
17 class GURL; | 17 class GURL; |
18 class Profile; | 18 class Profile; |
19 | 19 |
20 namespace gdata { | 20 namespace gdata { |
21 | 21 |
22 class GDataOperationInterface; | 22 class GDataOperationInterface; |
23 class GDataOperationRegistry; | 23 class GDataOperationRegistry; |
24 class GDataOperationRunner; | 24 class GDataOperationRunner; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // identified with |parent_content_url|. If |parent_content_url| is empty, | 172 // identified with |parent_content_url|. If |parent_content_url| is empty, |
173 // the new collection will be created in the root. Upon completion, | 173 // the new collection will be created in the root. Upon completion, |
174 // invokes |callback| and passes newly created entry on the calling thread. | 174 // invokes |callback| and passes newly created entry on the calling thread. |
175 virtual void CreateDirectory(const GURL& parent_content_url, | 175 virtual void CreateDirectory(const GURL& parent_content_url, |
176 const FilePath::StringType& directory_name, | 176 const FilePath::StringType& directory_name, |
177 const GetDataCallback& callback) = 0; | 177 const GetDataCallback& callback) = 0; |
178 | 178 |
179 // Downloads a file identified by its |content_url|. The downloaded file will | 179 // Downloads a file identified by its |content_url|. The downloaded file will |
180 // be stored at |local_cache_path| location. Upon completion, invokes | 180 // be stored at |local_cache_path| location. Upon completion, invokes |
181 // |download_action_callback| with results on the calling thread. | 181 // |download_action_callback| with results on the calling thread. |
182 // If |get_download_data_callback| is not empty, | 182 // If |get_content_callback| is not empty, |
183 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in | 183 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in |
184 // turn invoke |get_download_data_callback| on the calling thread. | 184 // turn invoke |get_content_callback| on the calling thread. |
185 virtual void DownloadFile( | 185 virtual void DownloadFile( |
186 const FilePath& virtual_path, | 186 const FilePath& virtual_path, |
187 const FilePath& local_cache_path, | 187 const FilePath& local_cache_path, |
188 const GURL& content_url, | 188 const GURL& content_url, |
189 const DownloadActionCallback& download_action_callback, | 189 const DownloadActionCallback& download_action_callback, |
190 const GetDownloadDataCallback& get_download_data_callback) = 0; | 190 const GetContentCallback& get_content_callback) = 0; |
191 | 191 |
192 // Initiates uploading of a document/file. | 192 // Initiates uploading of a document/file. |
193 virtual void InitiateUpload(const InitiateUploadParams& params, | 193 virtual void InitiateUpload(const InitiateUploadParams& params, |
194 const InitiateUploadCallback& callback) = 0; | 194 const InitiateUploadCallback& callback) = 0; |
195 | 195 |
196 // Resumes uploading of a document/file on the calling thread. | 196 // Resumes uploading of a document/file on the calling thread. |
197 virtual void ResumeUpload(const ResumeUploadParams& params, | 197 virtual void ResumeUpload(const ResumeUploadParams& params, |
198 const ResumeUploadCallback& callback) = 0; | 198 const ResumeUploadCallback& callback) = 0; |
199 | 199 |
200 // Authorizes a Drive app with the id |app_id| to open the given document. | 200 // Authorizes a Drive app with the id |app_id| to open the given document. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 const FilePath& virtual_path, | 244 const FilePath& virtual_path, |
245 const FilePath& local_cache_path, | 245 const FilePath& local_cache_path, |
246 const GURL& content_url, | 246 const GURL& content_url, |
247 DocumentExportFormat format, | 247 DocumentExportFormat format, |
248 const DownloadActionCallback& callback) OVERRIDE; | 248 const DownloadActionCallback& callback) OVERRIDE; |
249 virtual void DownloadFile( | 249 virtual void DownloadFile( |
250 const FilePath& virtual_path, | 250 const FilePath& virtual_path, |
251 const FilePath& local_cache_path, | 251 const FilePath& local_cache_path, |
252 const GURL& content_url, | 252 const GURL& content_url, |
253 const DownloadActionCallback& download_action_callback, | 253 const DownloadActionCallback& download_action_callback, |
254 const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; | 254 const GetContentCallback& get_content_callback) OVERRIDE; |
255 virtual void CopyDocument(const std::string& resource_id, | 255 virtual void CopyDocument(const std::string& resource_id, |
256 const FilePath::StringType& new_name, | 256 const FilePath::StringType& new_name, |
257 const GetDataCallback& callback) OVERRIDE; | 257 const GetDataCallback& callback) OVERRIDE; |
258 virtual void RenameResource(const GURL& document_url, | 258 virtual void RenameResource(const GURL& document_url, |
259 const FilePath::StringType& new_name, | 259 const FilePath::StringType& new_name, |
260 const EntryActionCallback& callback) OVERRIDE; | 260 const EntryActionCallback& callback) OVERRIDE; |
261 virtual void AddResourceToDirectory( | 261 virtual void AddResourceToDirectory( |
262 const GURL& parent_content_url, | 262 const GURL& parent_content_url, |
263 const GURL& resource_url, | 263 const GURL& resource_url, |
264 const EntryActionCallback& callback) OVERRIDE; | 264 const EntryActionCallback& callback) OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
284 Profile* profile_; | 284 Profile* profile_; |
285 | 285 |
286 scoped_ptr<GDataOperationRunner> runner_; | 286 scoped_ptr<GDataOperationRunner> runner_; |
287 | 287 |
288 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 288 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
289 }; | 289 }; |
290 | 290 |
291 } // namespace gdata | 291 } // namespace gdata |
292 | 292 |
293 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 293 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
OLD | NEW |