| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/autofill/autofill_download_url.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "googleurl/src/gurl.h" |
| 10 |
| 11 const char kDefaultAutofillServiceUrl[] = |
| 12 "https://clients1.google.com/tbproxy/af/"; |
| 13 |
| 14 #if defined(GOOGLE_CHROME_BUILD) |
| 15 const char kClientName[] = "Google Chrome"; |
| 16 #else |
| 17 const char kClientName[] = "Chromium"; |
| 18 #endif // defined(GOOGLE_CHROME_BUILD) |
| 19 |
| 20 std::string AutofillDownloadUrl::GetBaseAutofillUrl() { |
| 21 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 22 std::string baseAutofillServiceUrl = command_line.GetSwitchValueASCII( |
| 23 switches::kAutofillServiceUrl); |
| 24 if (baseAutofillServiceUrl.empty()) |
| 25 return kDefaultAutofillServiceUrl; |
| 26 |
| 27 return baseAutofillServiceUrl; |
| 28 } |
| 29 |
| 30 GURL AutofillDownloadUrl::GetAutofillQueryUrl() { |
| 31 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); |
| 32 return GURL(baseAutofillServiceUrl + "query?client=" + kClientName); |
| 33 } |
| 34 |
| 35 GURL AutofillDownloadUrl::GetAutofillUploadUrl() { |
| 36 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); |
| 37 return GURL(baseAutofillServiceUrl + "upload?client=" + kClientName); |
| 38 } |
| 39 |
| OLD | NEW |