diff options
author | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 17:03:00 +0000 |
---|---|---|
committer | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 17:03:00 +0000 |
commit | 10923c1d89b7f60ab5f775b34a4c3ae124a28732 (patch) | |
tree | 82ee4038e93f694dc22f443ce1fe505671f5ac40 /chrome/browser/google_apis/drive_api_operations.h | |
parent | ab60bc9fd6089fac01badf936b8b7a1ac50512d6 (diff) | |
download | chromium_src-10923c1d89b7f60ab5f775b34a4c3ae124a28732.zip chromium_src-10923c1d89b7f60ab5f775b34a4c3ae124a28732.tar.gz chromium_src-10923c1d89b7f60ab5f775b34a4c3ae124a28732.tar.bz2 |
Implement RemoveResourceFromDirectory operation on Drive API v2.
This CL implement the operation to remove a resource (file or directory)
from a directory on Drive API v2.
BUG=14630
TEST=Ran unit_tests.
Review URL: https://chromiumcodereview.appspot.com/12096086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google_apis/drive_api_operations.h')
-rw-r--r-- | chrome/browser/google_apis/drive_api_operations.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/chrome/browser/google_apis/drive_api_operations.h b/chrome/browser/google_apis/drive_api_operations.h index 6325748..5ba17d7 100644 --- a/chrome/browser/google_apis/drive_api_operations.h +++ b/chrome/browser/google_apis/drive_api_operations.h @@ -238,6 +238,39 @@ class InsertResourceOperation : public EntryActionOperation { DISALLOW_COPY_AND_ASSIGN(InsertResourceOperation); }; +//========================== DeleteResourceOperation =========================== + +// This class performs the operation for removing a resource from a directory. +// Note that we use "delete" for the name of this class, which comes from the +// operation name of the Drive API v2, although we prefer "remove" for that +// sence in "drive/google_api" +// Also note that this is the operation of "Children: delete" of the Drive API +// v2. https://developers.google.com/drive/v2/reference/children/delete +class DeleteResourceOperation : public EntryActionOperation { + public: + // |callback| must not be null. + DeleteResourceOperation( + OperationRegistry* registry, + net::URLRequestContextGetter* url_request_context_getter, + const DriveApiUrlGenerator& url_generator, + const std::string& parent_resource_id, + const std::string& resource_id, + const EntryActionCallback& callback); + virtual ~DeleteResourceOperation(); + + protected: + // UrlFetchOperationBase overrides. + virtual GURL GetURL() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; + + private: + const DriveApiUrlGenerator url_generator_; + const std::string parent_resource_id_; + const std::string resource_id_; + + DISALLOW_COPY_AND_ASSIGN(DeleteResourceOperation); +}; + } // namespace drive } // namespace google_apis |