Chromium Code Reviews| 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_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 // TODO(kochi): Further split gdata_operations.h and include only necessary | 10 // TODO(kochi): Further split gdata_operations.h and include only necessary |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 // Gets the account metadata from the server using the default account | 139 // Gets the account metadata from the server using the default account |
| 140 // metadata URL. Upon completion, invokes |callback| with results on the | 140 // metadata URL. Upon completion, invokes |callback| with results on the |
| 141 // calling thread. | 141 // calling thread. |
| 142 virtual void GetAccountMetadata(const gdata::GetDataCallback& callback) = 0; | 142 virtual void GetAccountMetadata(const gdata::GetDataCallback& callback) = 0; |
| 143 | 143 |
| 144 // Gets the application information from the server. | 144 // Gets the application information from the server. |
| 145 // Upon completion, invokes |callback| with results on the calling thread. | 145 // Upon completion, invokes |callback| with results on the calling thread. |
| 146 virtual void GetApplicationInfo(const gdata::GetDataCallback& callback) = 0; | 146 virtual void GetApplicationInfo(const gdata::GetDataCallback& callback) = 0; |
| 147 | 147 |
| 148 // Deletes a document identified by its 'self' |url| and |etag|. | 148 // Deletes a document identified by its 'self' |url| and |etag|. |
| 149 // Upon completion, invokes |callback| with results on the calling thread. | 149 // Upon completion, invokes |callback| with results on the calling thread. |
|
satorux1
2012/10/17 01:00:38
Please add some comment about 'etag'.
tzik
2012/10/17 02:44:44
Done.
| |
| 150 virtual void DeleteDocument(const GURL& document_url, | 150 virtual void DeleteDocument(const GURL& document_url, |
| 151 const std::string& etag, | |
| 151 const gdata::EntryActionCallback& callback) = 0; | 152 const gdata::EntryActionCallback& callback) = 0; |
| 152 | 153 |
| 153 // Downloads a document identified by its |content_url| in a given |format|. | 154 // Downloads a document identified by its |content_url| in a given |format|. |
| 154 // Upon completion, invokes |callback| with results on the calling thread. | 155 // Upon completion, invokes |callback| with results on the calling thread. |
|
satorux1
2012/10/17 01:00:38
ditto.
tzik
2012/10/17 02:44:44
Done.
| |
| 155 virtual void DownloadDocument( | 156 virtual void DownloadDocument( |
| 156 const FilePath& virtual_path, | 157 const FilePath& virtual_path, |
| 157 const FilePath& local_cache_path, | 158 const FilePath& local_cache_path, |
| 158 const GURL& content_url, | 159 const GURL& content_url, |
| 159 DocumentExportFormat format, | 160 DocumentExportFormat format, |
| 161 const std::string& etag, | |
| 160 const gdata::DownloadActionCallback& callback) = 0; | 162 const gdata::DownloadActionCallback& callback) = 0; |
| 161 | 163 |
| 162 // Makes a copy of a document identified by its |resource_id|. | 164 // Makes a copy of a document identified by its |resource_id|. |
| 163 // The copy is named as the UTF-8 encoded |new_name| and is not added to any | 165 // The copy is named as the UTF-8 encoded |new_name| and is not added to any |
| 164 // collection. Use AddResourceToDirectory() to add the copy to a collection | 166 // collection. Use AddResourceToDirectory() to add the copy to a collection |
| 165 // when needed. Upon completion, invokes |callback| with results on the | 167 // when needed. Upon completion, invokes |callback| with results on the |
| 166 // calling thread. | 168 // calling thread. |
| 167 virtual void CopyDocument(const std::string& resource_id, | 169 virtual void CopyDocument(const std::string& resource_id, |
| 168 const FilePath::StringType& new_name, | 170 const FilePath::StringType& new_name, |
| 169 const gdata::GetDataCallback& callback) = 0; | 171 const gdata::GetDataCallback& callback) = 0; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 // Downloads a file identified by its |content_url|. The downloaded file will | 207 // Downloads a file identified by its |content_url|. The downloaded file will |
| 206 // be stored at |local_cache_path| location. Upon completion, invokes | 208 // be stored at |local_cache_path| location. Upon completion, invokes |
| 207 // |download_action_callback| with results on the calling thread. | 209 // |download_action_callback| with results on the calling thread. |
| 208 // If |get_content_callback| is not empty, | 210 // If |get_content_callback| is not empty, |
| 209 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in | 211 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in |
| 210 // turn invoke |get_content_callback| on the calling thread. | 212 // turn invoke |get_content_callback| on the calling thread. |
| 211 virtual void DownloadFile( | 213 virtual void DownloadFile( |
| 212 const FilePath& virtual_path, | 214 const FilePath& virtual_path, |
| 213 const FilePath& local_cache_path, | 215 const FilePath& local_cache_path, |
| 214 const GURL& content_url, | 216 const GURL& content_url, |
| 217 const std::string& etag, | |
|
satorux1
2012/10/17 01:00:38
ditto.
tzik
2012/10/17 02:44:44
Done.
| |
| 215 const gdata::DownloadActionCallback& download_action_callback, | 218 const gdata::DownloadActionCallback& download_action_callback, |
| 216 const gdata::GetContentCallback& get_content_callback) = 0; | 219 const gdata::GetContentCallback& get_content_callback) = 0; |
| 217 | 220 |
| 218 // Initiates uploading of a document/file. | 221 // Initiates uploading of a document/file. |
| 219 virtual void InitiateUpload( | 222 virtual void InitiateUpload( |
| 220 const gdata::InitiateUploadParams& params, | 223 const gdata::InitiateUploadParams& params, |
| 221 const gdata::InitiateUploadCallback& callback) = 0; | 224 const gdata::InitiateUploadCallback& callback) = 0; |
| 222 | 225 |
| 223 // Resumes uploading of a document/file on the calling thread. | 226 // Resumes uploading of a document/file on the calling thread. |
| 224 virtual void ResumeUpload(const gdata::ResumeUploadParams& params, | 227 virtual void ResumeUpload(const gdata::ResumeUploadParams& params, |
| 225 const gdata::ResumeUploadCallback& callback) = 0; | 228 const gdata::ResumeUploadCallback& callback) = 0; |
| 226 | 229 |
| 227 // Authorizes a Drive app with the id |app_id| to open the given document. | 230 // Authorizes a Drive app with the id |app_id| to open the given document. |
| 228 // Upon completion, invokes |callback| with results on the calling thread. | 231 // Upon completion, invokes |callback| with results on the calling thread. |
| 229 virtual void AuthorizeApp(const GURL& resource_url, | 232 virtual void AuthorizeApp(const GURL& resource_url, |
| 230 const std::string& app_id, | 233 const std::string& app_id, |
| 231 const gdata::GetDataCallback& callback) = 0; | 234 const gdata::GetDataCallback& callback) = 0; |
| 232 }; | 235 }; |
| 233 | 236 |
| 234 } // namespace drive | 237 } // namespace drive |
| 235 | 238 |
| 236 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 239 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
| OLD | NEW |