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 "components/autofill/browser/autofill_download_url.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/command_line.h" | |
10 #include "components/autofill/core/common/autofill_switches.h" | |
11 #include "googleurl/src/gurl.h" | |
12 | |
13 namespace autofill { | |
14 namespace { | |
15 | |
16 const char kDefaultAutofillServiceUrl[] = | |
17 "https://clients1.google.com/tbproxy/af/"; | |
18 | |
19 #if defined(GOOGLE_CHROME_BUILD) | |
20 const char kClientName[] = "Google Chrome"; | |
21 #else | |
22 const char kClientName[] = "Chromium"; | |
23 #endif // defined(GOOGLE_CHROME_BUILD) | |
24 | |
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; | |
31 | |
32 return baseAutofillServiceUrl; | |
33 } | |
34 | |
35 } // namespace | |
36 | |
37 GURL GetAutofillQueryUrl() { | |
38 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); | |
39 return GURL(baseAutofillServiceUrl + "query?client=" + kClientName); | |
40 } | |
41 | |
42 GURL GetAutofillUploadUrl() { | |
43 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); | |
44 return GURL(baseAutofillServiceUrl + "upload?client=" + kClientName); | |
45 } | |
46 | |
47 } // namespace autofill | |
OLD | NEW |