Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/autofill/autofill_download_url.cc

Issue 11230060: Adding commandline switch and user pref for autofill server url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplifying AutofillDownloadUrl further Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698