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

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

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 months 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 "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
OLDNEW
« no previous file with comments | « components/autofill/browser/autofill_download_url.h ('k') | components/autofill/browser/autofill_download_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698