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