1 // Copyright 2013 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.
5 #include "components/autofill/core/browser/autofill_download_url.h"
9 #include "base/command_line.h"
10 #include "components/autofill/core/common/autofill_switches.h"
16 const char kDefaultAutofillServiceUrl[] =
17 "https://clients1.google.com/tbproxy/af/";
19 #if defined(GOOGLE_CHROME_BUILD)
20 const char kClientName[] = "Google Chrome";
22 const char kClientName[] = "Chromium";
23 #endif // defined(GOOGLE_CHROME_BUILD)
25 std::string GetBaseAutofillUrl() {
26 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
27 std::string baseAutofillServiceUrl = command_line.GetSwitchValueASCII(
28 switches::kAutofillServiceUrl);
29 if (baseAutofillServiceUrl.empty())
30 return kDefaultAutofillServiceUrl;
32 return baseAutofillServiceUrl;
37 GURL GetAutofillQueryUrl() {
38 std::string baseAutofillServiceUrl = GetBaseAutofillUrl();
39 return GURL(baseAutofillServiceUrl + "query?client=" + kClientName);
42 GURL GetAutofillUploadUrl() {
43 std::string baseAutofillServiceUrl = GetBaseAutofillUrl();
44 return GURL(baseAutofillServiceUrl + "upload?client=" + kClientName);
47 } // namespace autofill