| 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/gdata_wapi_url_generator.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 const char GDataWapiUrlGenerator::kBaseUrlForProduction[] = | 74 const char GDataWapiUrlGenerator::kBaseUrlForProduction[] = |
| 75 "https://docs.google.com/"; | 75 "https://docs.google.com/"; |
| 76 | 76 |
| 77 // static | 77 // static |
| 78 GURL GDataWapiUrlGenerator::AddStandardUrlParams(const GURL& url) { | 78 GURL GDataWapiUrlGenerator::AddStandardUrlParams(const GURL& url) { |
| 79 GURL result = net::AppendOrReplaceQueryParameter(url, "v", "3"); | 79 GURL result = net::AppendOrReplaceQueryParameter(url, "v", "3"); |
| 80 result = net::AppendOrReplaceQueryParameter(result, "alt", "json"); | 80 result = net::AppendOrReplaceQueryParameter(result, "alt", "json"); |
| 81 result = net::AppendOrReplaceQueryParameter(result, "showroot", "true"); |
| 81 return result; | 82 return result; |
| 82 } | 83 } |
| 83 | 84 |
| 84 // static | 85 // static |
| 85 GURL GDataWapiUrlGenerator::AddInitiateUploadUrlParams(const GURL& url) { | 86 GURL GDataWapiUrlGenerator::AddInitiateUploadUrlParams(const GURL& url) { |
| 86 GURL result = net::AppendOrReplaceQueryParameter(url, "convert", "false"); | 87 GURL result = net::AppendOrReplaceQueryParameter(url, "convert", "false"); |
| 87 return AddStandardUrlParams(result); | 88 return AddStandardUrlParams(result); |
| 88 } | 89 } |
| 89 | 90 |
| 90 // static | 91 // static |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 bool include_installed_apps) const { | 218 bool include_installed_apps) const { |
| 218 GURL result = AddStandardUrlParams(base_url_.Resolve(kAccountMetadataURL)); | 219 GURL result = AddStandardUrlParams(base_url_.Resolve(kAccountMetadataURL)); |
| 219 if (include_installed_apps) { | 220 if (include_installed_apps) { |
| 220 result = net::AppendOrReplaceQueryParameter( | 221 result = net::AppendOrReplaceQueryParameter( |
| 221 result, "include-installed-apps", "true"); | 222 result, "include-installed-apps", "true"); |
| 222 } | 223 } |
| 223 return result; | 224 return result; |
| 224 } | 225 } |
| 225 | 226 |
| 226 } // namespace google_apis | 227 } // namespace google_apis |
| OLD | NEW |