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

Side by Side Diff: components/autofill/content/browser/wallet/wallet_service_url.cc

Issue 16749002: Talk to production wallet server when Autocheckout experiment is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/content/browser/wallet/wallet_service_url.h" 5 #include "components/autofill/content/browser/wallet/wallet_service_url.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 11 matching lines...) Expand all
22 const char kSandboxWalletServiceUrl[] = 22 const char kSandboxWalletServiceUrl[] =
23 "https://payments-form-dogfood.sandbox.google.com/"; 23 "https://payments-form-dogfood.sandbox.google.com/";
24 24
25 // TODO(ahutter): Remove this once production is ready. 25 // TODO(ahutter): Remove this once production is ready.
26 const char kSandboxWalletSecureServiceUrl[] = 26 const char kSandboxWalletSecureServiceUrl[] =
27 "https://wallet-web.sandbox.google.com/"; 27 "https://wallet-web.sandbox.google.com/";
28 28
29 bool IsWalletProductionEnabled() { 29 bool IsWalletProductionEnabled() {
30 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 30 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
31 return command_line.HasSwitch(switches::kWalletServiceUseProd) || 31 return command_line.HasSwitch(switches::kWalletServiceUseProd) ||
32 base::FieldTrialList::FindFullName("WalletProductionService") == "Yes"; 32 base::FieldTrialList::FindFullName("WalletProductionService") == "Yes" ||
33 base::FieldTrialList::FindFullName("Autocheckout") == "Yes";
33 } 34 }
34 35
35 GURL GetWalletHostUrl() { 36 GURL GetWalletHostUrl() {
36 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 37 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
37 std::string wallet_service_hostname = 38 std::string wallet_service_hostname =
38 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); 39 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl);
39 if (!wallet_service_hostname.empty()) 40 if (!wallet_service_hostname.empty())
40 return GURL(wallet_service_hostname); 41 return GURL(wallet_service_hostname);
41 if (IsWalletProductionEnabled()) 42 if (IsWalletProductionEnabled())
42 return GURL(kProdWalletServiceUrl); 43 return GURL(kProdWalletServiceUrl);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 url.host() == final_url.host() && 148 url.host() == final_url.host() &&
148 url.path() == final_url.path(); 149 url.path() == final_url.path();
149 } 150 }
150 151
151 bool IsUsingProd() { 152 bool IsUsingProd() {
152 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); 153 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl);
153 } 154 }
154 155
155 } // namespace wallet 156 } // namespace wallet
156 } // namespace autofill 157 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698