Chromium Code Reviews| 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 GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "google_apis/drive/drive_switches.h" | 13 #include "google_apis/drive/drive_switches.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace google_apis { | 16 namespace google_apis { |
| 17 | 17 |
| 18 enum FilesListCorpora { | |
|
hashimoto
2017/06/05 04:29:22
Please add comments to describe what this enum is
yamaguchi
2017/06/05 05:09:07
Done.
| |
| 19 CORPORA_DEFAULT, | |
|
hashimoto
2017/06/05 04:29:22
How about making this an enum class?
enum class F
yamaguchi
2017/06/05 05:09:07
Done.
| |
| 20 CORPORA_TEAM_DRIVE, | |
| 21 CORPORA_ALL_TEAM_DRIVES, | |
| 22 }; | |
| 23 | |
| 18 // This class is used to generate URLs for communicating with drive api | 24 // This class is used to generate URLs for communicating with drive api |
| 19 // servers for production, and a local server for testing. | 25 // servers for production, and a local server for testing. |
| 20 class DriveApiUrlGenerator { | 26 class DriveApiUrlGenerator { |
| 21 public: | 27 public: |
| 22 // |base_url| is the path to the target drive api server. | 28 // |base_url| is the path to the target drive api server. |
| 23 // Note that this is an injecting point for a testing server. | 29 // Note that this is an injecting point for a testing server. |
| 24 DriveApiUrlGenerator(const GURL& base_url, | 30 DriveApiUrlGenerator(const GURL& base_url, |
| 25 const GURL& base_thumbnail_url, | 31 const GURL& base_thumbnail_url, |
| 26 TeamDrivesIntegrationStatus team_drives_integration); | 32 TeamDrivesIntegrationStatus team_drives_integration); |
| 27 DriveApiUrlGenerator(const DriveApiUrlGenerator& src); | 33 DriveApiUrlGenerator(const DriveApiUrlGenerator& src); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 bool set_modified_date, | 67 bool set_modified_date, |
| 62 bool update_viewed_date) const; | 68 bool update_viewed_date) const; |
| 63 | 69 |
| 64 // Returns a URL to copy a resource specified by |file_id|. | 70 // Returns a URL to copy a resource specified by |file_id|. |
| 65 GURL GetFilesCopyUrl(const std::string& file_id, | 71 GURL GetFilesCopyUrl(const std::string& file_id, |
| 66 const std::string& visibility) const; | 72 const std::string& visibility) const; |
| 67 | 73 |
| 68 // Returns a URL to fetch file list. | 74 // Returns a URL to fetch file list. |
| 69 GURL GetFilesListUrl(int max_results, | 75 GURL GetFilesListUrl(int max_results, |
| 70 const std::string& page_token, | 76 const std::string& page_token, |
| 77 FilesListCorpora corpora, | |
| 78 const std::string& team_drive_id, | |
| 71 const std::string& q) const; | 79 const std::string& q) const; |
| 72 | 80 |
| 73 // Returns a URL to delete a resource with the given |file_id|. | 81 // Returns a URL to delete a resource with the given |file_id|. |
| 74 GURL GetFilesDeleteUrl(const std::string& file_id) const; | 82 GURL GetFilesDeleteUrl(const std::string& file_id) const; |
| 75 | 83 |
| 76 // Returns a URL to trash a resource with the given |file_id|. | 84 // Returns a URL to trash a resource with the given |file_id|. |
| 77 GURL GetFilesTrashUrl(const std::string& file_id) const; | 85 GURL GetFilesTrashUrl(const std::string& file_id) const; |
| 78 | 86 |
| 79 // Returns a URL to invoke "TeamDrives: list" method. | 87 // Returns a URL to invoke "TeamDrives: list" method. |
| 80 GURL GetTeamDriveListUrl(int max_results, | 88 GURL GetTeamDriveListUrl(int max_results, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 const GURL base_download_url_; | 143 const GURL base_download_url_; |
| 136 const GURL base_thumbnail_url_; | 144 const GURL base_thumbnail_url_; |
| 137 const bool enable_team_drives_; | 145 const bool enable_team_drives_; |
| 138 | 146 |
| 139 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. | 147 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. |
| 140 }; | 148 }; |
| 141 | 149 |
| 142 } // namespace google_apis | 150 } // namespace google_apis |
| 143 | 151 |
| 144 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 152 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| OLD | NEW |