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_GDATA_WAPI_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 protected: | 151 protected: |
152 // Overridden from UrlFetchOperationBase. | 152 // Overridden from UrlFetchOperationBase. |
153 virtual GURL GetURL() const OVERRIDE; | 153 virtual GURL GetURL() const OVERRIDE; |
154 | 154 |
155 // Overridden from EntryActionOperation. | 155 // Overridden from EntryActionOperation. |
156 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 156 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
157 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 157 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
158 | 158 |
159 private: | 159 private: |
| 160 GURL document_url_; |
| 161 |
160 DISALLOW_COPY_AND_ASSIGN(DeleteDocumentOperation); | 162 DISALLOW_COPY_AND_ASSIGN(DeleteDocumentOperation); |
161 }; | 163 }; |
162 | 164 |
163 //========================== CreateDirectoryOperation ========================== | 165 //========================== CreateDirectoryOperation ========================== |
164 | 166 |
165 // This class performs the operation for creating a directory. | 167 // This class performs the operation for creating a directory. |
166 class CreateDirectoryOperation : public GetDataOperation { | 168 class CreateDirectoryOperation : public GetDataOperation { |
167 public: | 169 public: |
168 // Empty |parent_content_url| will create the directory in the root folder. | 170 // Empty |parent_content_url| will create the directory in the root folder. |
169 CreateDirectoryOperation(OperationRegistry* registry, | 171 CreateDirectoryOperation(OperationRegistry* registry, |
(...skipping 26 matching lines...) Expand all Loading... |
196 class CopyDocumentOperation : public GetDataOperation { | 198 class CopyDocumentOperation : public GetDataOperation { |
197 public: | 199 public: |
198 CopyDocumentOperation(OperationRegistry* registry, | 200 CopyDocumentOperation(OperationRegistry* registry, |
199 const GDataWapiUrlGenerator& url_generator, | 201 const GDataWapiUrlGenerator& url_generator, |
200 const GetDataCallback& callback, | 202 const GetDataCallback& callback, |
201 const std::string& resource_id, | 203 const std::string& resource_id, |
202 const FilePath::StringType& new_name); | 204 const FilePath::StringType& new_name); |
203 virtual ~CopyDocumentOperation(); | 205 virtual ~CopyDocumentOperation(); |
204 | 206 |
205 protected: | 207 protected: |
206 // Overridden from GetDataOperation. | 208 // Overridden from UrlFetchOperationBase. |
207 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 209 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
208 | 210 |
209 // Overridden from UrlFetchOperationBase. | 211 // Overridden from UrlFetchOperationBase. |
210 virtual GURL GetURL() const OVERRIDE; | 212 virtual GURL GetURL() const OVERRIDE; |
211 virtual bool GetContentData(std::string* upload_content_type, | 213 virtual bool GetContentData(std::string* upload_content_type, |
212 std::string* upload_content) OVERRIDE; | 214 std::string* upload_content) OVERRIDE; |
213 | 215 |
214 private: | 216 private: |
215 GDataWapiUrlGenerator url_generator_; | 217 GDataWapiUrlGenerator url_generator_; |
216 std::string resource_id_; | 218 std::string resource_id_; |
(...skipping 17 matching lines...) Expand all Loading... |
234 // Overridden from EntryActionOperation. | 236 // Overridden from EntryActionOperation. |
235 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 237 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
236 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 238 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
237 | 239 |
238 // Overridden from UrlFetchOperationBase. | 240 // Overridden from UrlFetchOperationBase. |
239 virtual GURL GetURL() const OVERRIDE; | 241 virtual GURL GetURL() const OVERRIDE; |
240 virtual bool GetContentData(std::string* upload_content_type, | 242 virtual bool GetContentData(std::string* upload_content_type, |
241 std::string* upload_content) OVERRIDE; | 243 std::string* upload_content) OVERRIDE; |
242 | 244 |
243 private: | 245 private: |
| 246 GURL document_url_; |
244 FilePath::StringType new_name_; | 247 FilePath::StringType new_name_; |
245 | 248 |
246 DISALLOW_COPY_AND_ASSIGN(RenameResourceOperation); | 249 DISALLOW_COPY_AND_ASSIGN(RenameResourceOperation); |
247 }; | 250 }; |
248 | 251 |
249 //=========================== AuthorizeAppOperation ========================== | 252 //=========================== AuthorizeAppOperation ========================== |
250 | 253 |
251 // This class performs the operation for authorizing an application specified | 254 // This class performs the operation for authorizing an application specified |
252 // by |app_id| to access a document specified by |document_url| for . | 255 // by |app_id| to access a document specified by |document_url| for . |
253 class AuthorizeAppOperation : public GetDataOperation { | 256 class AuthorizeAppOperation : public GetDataOperation { |
254 public: | 257 public: |
255 AuthorizeAppOperation(OperationRegistry* registry, | 258 AuthorizeAppOperation(OperationRegistry* registry, |
256 const GetDataCallback& callback, | 259 const GetDataCallback& callback, |
257 const GURL& document_url, | 260 const GURL& document_url, |
258 const std::string& app_id); | 261 const std::string& app_id); |
259 virtual ~AuthorizeAppOperation(); | 262 virtual ~AuthorizeAppOperation(); |
260 | 263 |
261 protected: | 264 protected: |
262 // Overridden from EntryActionOperation. | 265 // Overridden from GetDataOperation. |
263 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 266 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
264 | 267 |
265 // Overridden from UrlFetchOperationBase. | 268 // Overridden from UrlFetchOperationBase. |
266 virtual bool GetContentData(std::string* upload_content_type, | 269 virtual bool GetContentData(std::string* upload_content_type, |
267 std::string* upload_content) OVERRIDE; | 270 std::string* upload_content) OVERRIDE; |
268 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 271 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
269 | 272 |
270 // Overridden from GetDataOperation. | 273 // Overridden from GetDataOperation. |
271 virtual GURL GetURL() const OVERRIDE; | 274 virtual GURL GetURL() const OVERRIDE; |
272 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; | 275 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
299 protected: | 302 protected: |
300 // Overridden from UrlFetchOperationBase. | 303 // Overridden from UrlFetchOperationBase. |
301 virtual GURL GetURL() const OVERRIDE; | 304 virtual GURL GetURL() const OVERRIDE; |
302 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 305 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
303 virtual bool GetContentData(std::string* upload_content_type, | 306 virtual bool GetContentData(std::string* upload_content_type, |
304 std::string* upload_content) OVERRIDE; | 307 std::string* upload_content) OVERRIDE; |
305 | 308 |
306 private: | 309 private: |
307 GDataWapiUrlGenerator url_generator_; | 310 GDataWapiUrlGenerator url_generator_; |
308 GURL parent_content_url_; | 311 GURL parent_content_url_; |
| 312 GURL document_url_; |
309 | 313 |
310 DISALLOW_COPY_AND_ASSIGN(AddResourceToDirectoryOperation); | 314 DISALLOW_COPY_AND_ASSIGN(AddResourceToDirectoryOperation); |
311 }; | 315 }; |
312 | 316 |
313 //==================== RemoveResourceFromDirectoryOperation ==================== | 317 //==================== RemoveResourceFromDirectoryOperation ==================== |
314 | 318 |
315 // This class performs the operation for adding a document/file/directory | 319 // This class performs the operation for adding a document/file/directory |
316 // from a directory. | 320 // from a directory. |
| 321 // |
| 322 // TODO(satorux): Remove |document_url| parameter. crbug.com/163308 |
317 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { | 323 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { |
318 public: | 324 public: |
319 RemoveResourceFromDirectoryOperation(OperationRegistry* registry, | 325 RemoveResourceFromDirectoryOperation(OperationRegistry* registry, |
320 const EntryActionCallback& callback, | 326 const EntryActionCallback& callback, |
321 const GURL& parent_content_url, | 327 const GURL& parent_content_url, |
322 const GURL& document_url, | 328 const GURL& document_url, |
323 const std::string& resource_id); | 329 const std::string& resource_id); |
324 virtual ~RemoveResourceFromDirectoryOperation(); | 330 virtual ~RemoveResourceFromDirectoryOperation(); |
325 | 331 |
326 protected: | 332 protected: |
327 // Overridden from UrlFetchOperationBase. | 333 // Overridden from UrlFetchOperationBase. |
328 virtual GURL GetURL() const OVERRIDE; | 334 virtual GURL GetURL() const OVERRIDE; |
329 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 335 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
330 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 336 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
331 | 337 |
332 private: | 338 private: |
333 std::string resource_id_; | 339 std::string resource_id_; |
334 GURL parent_content_url_; | 340 GURL parent_content_url_; |
| 341 GURL document_url_; |
335 | 342 |
336 DISALLOW_COPY_AND_ASSIGN(RemoveResourceFromDirectoryOperation); | 343 DISALLOW_COPY_AND_ASSIGN(RemoveResourceFromDirectoryOperation); |
337 }; | 344 }; |
338 | 345 |
339 //=========================== InitiateUploadOperation ========================== | 346 //=========================== InitiateUploadOperation ========================== |
340 | 347 |
341 // Struct for passing params needed for DriveServiceInterface::InitiateUpload() | 348 // Struct for passing params needed for DriveServiceInterface::InitiateUpload() |
342 // calls. | 349 // calls. |
343 // | 350 // |
344 // When uploading a new file (UPLOAD_NEW_FILE): | 351 // When uploading a new file (UPLOAD_NEW_FILE): |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 ResumeUploadCallback callback_; | 480 ResumeUploadCallback callback_; |
474 ResumeUploadParams params_; | 481 ResumeUploadParams params_; |
475 bool last_chunk_completed_; | 482 bool last_chunk_completed_; |
476 | 483 |
477 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); | 484 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); |
478 }; | 485 }; |
479 | 486 |
480 } // namespace google_apis | 487 } // namespace google_apis |
481 | 488 |
482 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ | 489 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_ |
OLD | NEW |