Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/google_apis/drive_api_url_generator.h

Issue 23757004: Refactor InsertResourceRequest and DeleteResourceRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_API_URL_GENERATOR_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_ 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Returns a URL to touch a resource specified by |resource_id|. 57 // Returns a URL to touch a resource specified by |resource_id|.
58 GURL GetFileTouchUrl(const std::string& resource_id) const; 58 GURL GetFileTouchUrl(const std::string& resource_id) const;
59 59
60 // Returns a URL to fetch a list of changes. 60 // Returns a URL to fetch a list of changes.
61 GURL GetChangesListUrl(bool include_deleted, 61 GURL GetChangesListUrl(bool include_deleted,
62 int max_results, 62 int max_results,
63 const std::string& page_token, 63 const std::string& page_token,
64 int64 start_change_id) const; 64 int64 start_change_id) const;
65 65
66 // Returns a URL to add a resource to a directory with |resource_id|. 66 // Returns a URL to add a resource to a directory with |folder_id|.
67 // Note that the |resource_id| is corresponding to the "folder id" in the 67 GURL GetChildrenInsertUrl(const std::string& folder_id) const;
68 // document: https://developers.google.com/drive/v2/reference/children/insert
69 // but we use the term "resource" for consistency in our code.
70 GURL GetChildrenUrl(const std::string& resource_id) const;
71 68
72 // Returns a URL to remove a resource with |child_id| from a directory 69 // Returns a URL to remove a resource with |child_id| from a directory
73 // with |folder_id|. 70 // with |folder_id|.
74 // Note that we use the name "folder" for the parameter, in order to be 71 GURL GetChildrenDeleteUrl(const std::string& child_id,
75 // consistent with the drive API document: 72 const std::string& folder_id) const;
76 // https://developers.google.com/drive/v2/reference/children/delete
77 GURL GetChildrenUrlForRemoval(const std::string& folder_id,
78 const std::string& child_id) const;
79 73
80 // Returns a URL to initiate uploading a new file. 74 // Returns a URL to initiate uploading a new file.
81 GURL GetInitiateUploadNewFileUrl() const; 75 GURL GetInitiateUploadNewFileUrl() const;
82 76
83 // Returns a URL to initiate uploading an existing file specified by 77 // Returns a URL to initiate uploading an existing file specified by
84 // |resource_id|. 78 // |resource_id|.
85 GURL GetInitiateUploadExistingFileUrl(const std::string& resource_id) const; 79 GURL GetInitiateUploadExistingFileUrl(const std::string& resource_id) const;
86 80
87 // Generates a URL for downloading a file. 81 // Generates a URL for downloading a file.
88 GURL GenerateDownloadFileUrl(const std::string& resource_id) const; 82 GURL GenerateDownloadFileUrl(const std::string& resource_id) const;
89 83
90 private: 84 private:
91 const GURL base_url_; 85 const GURL base_url_;
92 const GURL base_download_url_; 86 const GURL base_download_url_;
93 87
94 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. 88 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here.
95 }; 89 };
96 90
97 } // namespace google_apis 91 } // namespace google_apis
98 92
99 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_ 93 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/drive_api_requests_unittest.cc ('k') | chrome/browser/google_apis/drive_api_url_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698