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 #include "chrome/browser/google_apis/drive_api_url_generator.h" | 5 #include "chrome/browser/google_apis/drive_api_url_generator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 "https://www.googledrive.com/host/"; | 58 "https://www.googledrive.com/host/"; |
59 | 59 |
60 GURL DriveApiUrlGenerator::GetAboutGetUrl() const { | 60 GURL DriveApiUrlGenerator::GetAboutGetUrl() const { |
61 return base_url_.Resolve(kDriveV2AboutUrl); | 61 return base_url_.Resolve(kDriveV2AboutUrl); |
62 } | 62 } |
63 | 63 |
64 GURL DriveApiUrlGenerator::GetAppsListUrl() const { | 64 GURL DriveApiUrlGenerator::GetAppsListUrl() const { |
65 return base_url_.Resolve(kDriveV2AppsUrl); | 65 return base_url_.Resolve(kDriveV2AppsUrl); |
66 } | 66 } |
67 | 67 |
68 GURL DriveApiUrlGenerator::GetFilesUrl() const { | |
69 return base_url_.Resolve(kDriveV2FilesUrl); | |
70 } | |
71 | |
72 GURL DriveApiUrlGenerator::GetFilesGetUrl(const std::string& file_id) const { | 68 GURL DriveApiUrlGenerator::GetFilesGetUrl(const std::string& file_id) const { |
73 return base_url_.Resolve(kDriveV2FileUrlPrefix + net::EscapePath(file_id)); | 69 return base_url_.Resolve(kDriveV2FileUrlPrefix + net::EscapePath(file_id)); |
74 } | 70 } |
75 | 71 |
| 72 GURL DriveApiUrlGenerator::GetFilesInsertUrl() const { |
| 73 return base_url_.Resolve(kDriveV2FilesUrl); |
| 74 } |
| 75 |
76 GURL DriveApiUrlGenerator::GetFilesPatchUrl(const std::string& file_id, | 76 GURL DriveApiUrlGenerator::GetFilesPatchUrl(const std::string& file_id, |
77 bool set_modified_date, | 77 bool set_modified_date, |
78 bool update_viewed_date) const { | 78 bool update_viewed_date) const { |
79 GURL url = | 79 GURL url = |
80 base_url_.Resolve(kDriveV2FileUrlPrefix + net::EscapePath(file_id)); | 80 base_url_.Resolve(kDriveV2FileUrlPrefix + net::EscapePath(file_id)); |
81 | 81 |
82 // setModifiedDate is "false" by default. | 82 // setModifiedDate is "false" by default. |
83 if (set_modified_date) | 83 if (set_modified_date) |
84 url = net::AppendOrReplaceQueryParameter(url, "setModifiedDate", "true"); | 84 url = net::AppendOrReplaceQueryParameter(url, "setModifiedDate", "true"); |
85 | 85 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 net::EscapePath(resource_id)); | 191 net::EscapePath(resource_id)); |
192 return AddResumableUploadParam(url); | 192 return AddResumableUploadParam(url); |
193 } | 193 } |
194 | 194 |
195 GURL DriveApiUrlGenerator::GenerateDownloadFileUrl( | 195 GURL DriveApiUrlGenerator::GenerateDownloadFileUrl( |
196 const std::string& resource_id) const { | 196 const std::string& resource_id) const { |
197 return base_download_url_.Resolve(net::EscapePath(resource_id)); | 197 return base_download_url_.Resolve(net::EscapePath(resource_id)); |
198 } | 198 } |
199 | 199 |
200 } // namespace google_apis | 200 } // namespace google_apis |
OLD | NEW |