Chromium Code Reviews| 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 { | |
|
Ilya Sherman
2012/10/29 16:47:54
nit: Leave a blank line after this one.
ahutter
2012/10/29 17:03:53
Done.
| |
| 14 const char kDefaultAutofillServiceUrl[] = | |
| 15 "https://clients1.google.com/tbproxy/af/"; | |
| 16 | |
| 17 #if defined(GOOGLE_CHROME_BUILD) | |
| 18 const char kClientName[] = "Google Chrome"; | |
| 19 #else | |
| 20 const char kClientName[] = "Chromium"; | |
| 21 #endif // defined(GOOGLE_CHROME_BUILD) | |
| 22 | |
| 23 std::string GetBaseAutofillUrl() { | |
| 24 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 25 std::string baseAutofillServiceUrl = command_line.GetSwitchValueASCII( | |
| 26 switches::kAutofillServiceUrl); | |
| 27 if (baseAutofillServiceUrl.empty()) | |
| 28 return kDefaultAutofillServiceUrl; | |
| 29 | |
| 30 return baseAutofillServiceUrl; | |
| 31 } | |
| 32 | |
| 33 } | |
|
Ilya Sherman
2012/10/29 16:47:54
nit: Please change this line to "} // anonymous n
ahutter
2012/10/29 17:03:53
Done.
| |
| 34 | |
| 35 GURL autofill::GetAutofillQueryUrl() { | |
| 36 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); | |
| 37 return GURL(baseAutofillServiceUrl + "query?client=" + kClientName); | |
| 38 } | |
| 39 | |
| 40 GURL autofill::GetAutofillUploadUrl() { | |
| 41 std::string baseAutofillServiceUrl = GetBaseAutofillUrl(); | |
| 42 return GURL(baseAutofillServiceUrl + "upload?client=" + kClientName); | |
| 43 } | |
| 44 | |
| OLD | NEW |