OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |