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

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

Powered by Google App Engine
This is Rietveld 408576698