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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 138 |
| 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' |document_url|. |
| 149 // If |etag| is set, checks if it matches the document before deletion. | |
|
satorux1
2012/10/17 03:14:27
If etag does not match, what happens? Please docum
| |
| 149 // Upon completion, invokes |callback| with results on the calling thread. | 150 // Upon completion, invokes |callback| with results on the calling thread. |
| 150 virtual void DeleteDocument(const GURL& document_url, | 151 virtual void DeleteDocument(const GURL& document_url, |
| 152 const std::string& etag, | |
| 151 const gdata::EntryActionCallback& callback) = 0; | 153 const gdata::EntryActionCallback& callback) = 0; |
| 152 | 154 |
| 153 // Downloads a document identified by its |content_url| in a given |format|. | 155 // Downloads a document identified by its |content_url| in a given |format|. |
| 156 // If |etag| is set, checks if it matches the document before downloading. | |
|
satorux1
2012/10/17 03:14:27
ditto.
| |
| 154 // Upon completion, invokes |callback| with results on the calling thread. | 157 // Upon completion, invokes |callback| with results on the calling thread. |
| 155 virtual void DownloadDocument( | 158 virtual void DownloadDocument( |
| 156 const FilePath& virtual_path, | 159 const FilePath& virtual_path, |
| 157 const FilePath& local_cache_path, | 160 const FilePath& local_cache_path, |
| 158 const GURL& content_url, | 161 const GURL& content_url, |
| 159 DocumentExportFormat format, | 162 DocumentExportFormat format, |
| 163 const std::string& etag, | |
| 160 const gdata::DownloadActionCallback& callback) = 0; | 164 const gdata::DownloadActionCallback& callback) = 0; |
| 161 | 165 |
| 162 // Makes a copy of a document identified by its |resource_id|. | 166 // 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 | 167 // 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 | 168 // collection. Use AddResourceToDirectory() to add the copy to a collection |
| 165 // when needed. Upon completion, invokes |callback| with results on the | 169 // when needed. Upon completion, invokes |callback| with results on the |
| 166 // calling thread. | 170 // calling thread. |
| 167 virtual void CopyDocument(const std::string& resource_id, | 171 virtual void CopyDocument(const std::string& resource_id, |
| 168 const FilePath::StringType& new_name, | 172 const FilePath::StringType& new_name, |
| 169 const gdata::GetDataCallback& callback) = 0; | 173 const gdata::GetDataCallback& callback) = 0; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 195 const gdata::EntryActionCallback& callback) = 0; | 199 const gdata::EntryActionCallback& callback) = 0; |
| 196 | 200 |
| 197 // Creates new collection with |directory_name| under parent directory | 201 // Creates new collection with |directory_name| under parent directory |
| 198 // identified with |parent_content_url|. If |parent_content_url| is empty, | 202 // identified with |parent_content_url|. If |parent_content_url| is empty, |
| 199 // the new collection will be created in the root. Upon completion, | 203 // the new collection will be created in the root. Upon completion, |
| 200 // invokes |callback| and passes newly created entry on the calling thread. | 204 // invokes |callback| and passes newly created entry on the calling thread. |
| 201 virtual void CreateDirectory(const GURL& parent_content_url, | 205 virtual void CreateDirectory(const GURL& parent_content_url, |
| 202 const FilePath::StringType& directory_name, | 206 const FilePath::StringType& directory_name, |
| 203 const gdata::GetDataCallback& callback) = 0; | 207 const gdata::GetDataCallback& callback) = 0; |
| 204 | 208 |
| 205 // Downloads a file identified by its |content_url|. The downloaded file will | 209 // Downloads a file identified by its |content_url|. |
| 206 // be stored at |local_cache_path| location. Upon completion, invokes | 210 // If |etag| is set, checks if it matches the file before downloading. |
|
satorux1
2012/10/17 03:14:27
ditto.
| |
| 207 // |download_action_callback| with results on the calling thread. | 211 // The downloaded file will be stored at |local_cache_path| location. |
| 212 // Upon completion, invokes |download_action_callback| with results on the | |
| 213 // calling thread. | |
| 208 // If |get_content_callback| is not empty, | 214 // If |get_content_callback| is not empty, |
| 209 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in | 215 // URLFetcherDelegate::OnURLFetchDownloadData will be called, which will in |
| 210 // turn invoke |get_content_callback| on the calling thread. | 216 // turn invoke |get_content_callback| on the calling thread. |
| 211 virtual void DownloadFile( | 217 virtual void DownloadFile( |
| 212 const FilePath& virtual_path, | 218 const FilePath& virtual_path, |
| 213 const FilePath& local_cache_path, | 219 const FilePath& local_cache_path, |
| 214 const GURL& content_url, | 220 const GURL& content_url, |
| 221 const std::string& etag, | |
| 215 const gdata::DownloadActionCallback& download_action_callback, | 222 const gdata::DownloadActionCallback& download_action_callback, |
| 216 const gdata::GetContentCallback& get_content_callback) = 0; | 223 const gdata::GetContentCallback& get_content_callback) = 0; |
| 217 | 224 |
| 218 // Initiates uploading of a document/file. | 225 // Initiates uploading of a document/file. |
| 219 virtual void InitiateUpload( | 226 virtual void InitiateUpload( |
| 220 const gdata::InitiateUploadParams& params, | 227 const gdata::InitiateUploadParams& params, |
| 221 const gdata::InitiateUploadCallback& callback) = 0; | 228 const gdata::InitiateUploadCallback& callback) = 0; |
| 222 | 229 |
| 223 // Resumes uploading of a document/file on the calling thread. | 230 // Resumes uploading of a document/file on the calling thread. |
| 224 virtual void ResumeUpload(const gdata::ResumeUploadParams& params, | 231 virtual void ResumeUpload(const gdata::ResumeUploadParams& params, |
| 225 const gdata::ResumeUploadCallback& callback) = 0; | 232 const gdata::ResumeUploadCallback& callback) = 0; |
| 226 | 233 |
| 227 // Authorizes a Drive app with the id |app_id| to open the given document. | 234 // 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. | 235 // Upon completion, invokes |callback| with results on the calling thread. |
| 229 virtual void AuthorizeApp(const GURL& resource_url, | 236 virtual void AuthorizeApp(const GURL& resource_url, |
| 230 const std::string& app_id, | 237 const std::string& app_id, |
| 231 const gdata::GetDataCallback& callback) = 0; | 238 const gdata::GetDataCallback& callback) = 0; |
| 232 }; | 239 }; |
| 233 | 240 |
| 234 } // namespace drive | 241 } // namespace drive |
| 235 | 242 |
| 236 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ | 243 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_SERVICE_INTERFACE_H_ |
| OLD | NEW |