| 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/common/cloud_print/cloud_print_helpers.h" | 5 #include "chrome/common/cloud_print/cloud_print_helpers.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 values_list.append(it->first); | 44 values_list.append(it->first); |
| 45 values_list.append(it->second); | 45 values_list.append(it->second); |
| 46 } | 46 } |
| 47 return base::MD5String(values_list); | 47 return base::MD5String(values_list); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 std::string AppendPathToUrl(const GURL& url, const std::string& path) { | 52 std::string AppendPathToUrl(const GURL& url, const std::string& path) { |
| 53 DCHECK_NE(path[0], '/'); | 53 DCHECK_NE(path[0], '/'); |
| 54 std::string ret = url.path(); | 54 std::string ret = url.path().as_string(); |
| 55 if (url.has_path() && (ret.back() != '/')) | 55 if (url.has_path() && (ret.back() != '/')) |
| 56 ret += '/'; | 56 ret += '/'; |
| 57 ret += path; | 57 ret += path; |
| 58 return ret; | 58 return ret; |
| 59 } | 59 } |
| 60 | 60 |
| 61 GURL GetUrlForSearch(const GURL& cloud_print_server_url) { | 61 GURL GetUrlForSearch(const GURL& cloud_print_server_url) { |
| 62 std::string path(AppendPathToUrl(cloud_print_server_url, "search")); | 62 std::string path(AppendPathToUrl(cloud_print_server_url, "search")); |
| 63 GURL::Replacements replacements; | 63 GURL::Replacements replacements; |
| 64 replacements.SetPathStr(path); | 64 replacements.SetPathStr(path); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 net::AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg, | 238 net::AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg, |
| 239 mime_boundary, std::string(), &post_data); | 239 mime_boundary, std::string(), &post_data); |
| 240 return post_data; | 240 return post_data; |
| 241 } | 241 } |
| 242 | 242 |
| 243 std::string GetCloudPrintAuthHeader(const std::string& auth_token) { | 243 std::string GetCloudPrintAuthHeader(const std::string& auth_token) { |
| 244 return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str()); | 244 return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace cloud_print | 247 } // namespace cloud_print |
| OLD | NEW |