| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // The base URL for the file download server for production. | 26 // The base URL for the file download server for production. |
| 27 static const char kBaseDownloadUrlForProduction[]; | 27 static const char kBaseDownloadUrlForProduction[]; |
| 28 | 28 |
| 29 // Returns a URL to invoke "About: get" method. | 29 // Returns a URL to invoke "About: get" method. |
| 30 GURL GetAboutGetUrl() const; | 30 GURL GetAboutGetUrl() const; |
| 31 | 31 |
| 32 // Returns a URL to invoke "Apps: list" method. | 32 // Returns a URL to invoke "Apps: list" method. |
| 33 GURL GetAppsListUrl() const; | 33 GURL GetAppsListUrl() const; |
| 34 | 34 |
| 35 // Returns a URL to fetch a list of changes. | |
| 36 // include_deleted: | |
| 37 // Set to true if the requesting change list should contain the deleted | |
| 38 // entries. Otherwise false. | |
| 39 // start_changestamp: | |
| 40 // The starting point of the requesting change list, or 0 if all changes | |
| 41 // are necessary. | |
| 42 // max_results: | |
| 43 // The max of the number of files resource in the response. | |
| 44 GURL GetChangelistUrl( | |
| 45 bool include_deleted, int64 start_changestamp, int max_results) const; | |
| 46 | |
| 47 // Returns a URL to edit (especially add) a resource, such as inserting | 35 // Returns a URL to edit (especially add) a resource, such as inserting |
| 48 // a file metadata or creating a new directory. | 36 // a file metadata or creating a new directory. |
| 49 GURL GetFilesUrl() const; | 37 GURL GetFilesUrl() const; |
| 50 | 38 |
| 51 // Returns a URL to fetch a file metadata. | 39 // Returns a URL to fetch a file metadata. |
| 52 GURL GetFilesGetUrl(const std::string& file_id) const; | 40 GURL GetFilesGetUrl(const std::string& file_id) const; |
| 53 | 41 |
| 54 // Returns a URL to patch file metadata. | 42 // Returns a URL to patch file metadata. |
| 55 GURL GetFilesPatchUrl(const std::string& file_id, | 43 GURL GetFilesPatchUrl(const std::string& file_id, |
| 56 bool set_modified_date, | 44 bool set_modified_date, |
| 57 bool update_viewed_date) const; | 45 bool update_viewed_date) const; |
| 58 | 46 |
| 59 // Returns a URL to fetch file list. | 47 // Returns a URL to fetch file list. |
| 60 GURL GetFilesListUrl(int max_results, | 48 GURL GetFilesListUrl(int max_results, |
| 61 const std::string& page_token, | 49 const std::string& page_token, |
| 62 const std::string& q) const; | 50 const std::string& q) const; |
| 63 | 51 |
| 64 // Returns a URL to copy a file specified by |resource_id|. | 52 // Returns a URL to copy a file specified by |resource_id|. |
| 65 GURL GetFileCopyUrl(const std::string& resource_id) const; | 53 GURL GetFileCopyUrl(const std::string& resource_id) const; |
| 66 | 54 |
| 67 // Returns a URL to touch a resource specified by |resource_id|. | 55 // Returns a URL to touch a resource specified by |resource_id|. |
| 68 GURL GetFileTouchUrl(const std::string& resource_id) const; | 56 GURL GetFileTouchUrl(const std::string& resource_id) const; |
| 69 | 57 |
| 70 // Returns a URL to trash a resource with the given |resource_id|. | 58 // Returns a URL to trash a resource with the given |resource_id|. |
| 71 // Note that the |resource_id| is corresponding to the "file id" in the | 59 // Note that the |resource_id| is corresponding to the "file id" in the |
| 72 // document: https://developers.google.com/drive/v2/reference/files/trash | 60 // document: https://developers.google.com/drive/v2/reference/files/trash |
| 73 // but we use the term "resource" for consistency in our code. | 61 // but we use the term "resource" for consistency in our code. |
| 74 GURL GetFileTrashUrl(const std::string& resource_id) const; | 62 GURL GetFileTrashUrl(const std::string& resource_id) const; |
| 75 | 63 |
| 64 // Returns a URL to fetch a list of changes. |
| 65 GURL GetChangesListUrl(bool include_deleted, |
| 66 int max_results, |
| 67 const std::string& page_token, |
| 68 int64 start_change_id) const; |
| 69 |
| 76 // Returns a URL to add a resource to a directory with |resource_id|. | 70 // Returns a URL to add a resource to a directory with |resource_id|. |
| 77 // Note that the |resource_id| is corresponding to the "folder id" in the | 71 // Note that the |resource_id| is corresponding to the "folder id" in the |
| 78 // document: https://developers.google.com/drive/v2/reference/children/insert | 72 // document: https://developers.google.com/drive/v2/reference/children/insert |
| 79 // but we use the term "resource" for consistency in our code. | 73 // but we use the term "resource" for consistency in our code. |
| 80 GURL GetChildrenUrl(const std::string& resource_id) const; | 74 GURL GetChildrenUrl(const std::string& resource_id) const; |
| 81 | 75 |
| 82 // Returns a URL to remove a resource with |child_id| from a directory | 76 // Returns a URL to remove a resource with |child_id| from a directory |
| 83 // with |folder_id|. | 77 // with |folder_id|. |
| 84 // Note that we use the name "folder" for the parameter, in order to be | 78 // Note that we use the name "folder" for the parameter, in order to be |
| 85 // consistent with the drive API document: | 79 // consistent with the drive API document: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 100 private: | 94 private: |
| 101 const GURL base_url_; | 95 const GURL base_url_; |
| 102 const GURL base_download_url_; | 96 const GURL base_download_url_; |
| 103 | 97 |
| 104 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. | 98 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. |
| 105 }; | 99 }; |
| 106 | 100 |
| 107 } // namespace google_apis | 101 } // namespace google_apis |
| 108 | 102 |
| 109 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_ | 103 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_ |
| OLD | NEW |