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"; | |
34 } | 33 } |
35 | 34 |
36 GURL GetWalletHostUrl() { | 35 GURL GetWalletHostUrl() { |
37 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 36 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
38 std::string wallet_service_hostname = | 37 std::string wallet_service_hostname = |
39 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); | 38 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); |
40 if (!wallet_service_hostname.empty()) | 39 if (!wallet_service_hostname.empty()) |
41 return GURL(wallet_service_hostname); | 40 return GURL(wallet_service_hostname); |
42 if (IsWalletProductionEnabled()) | 41 if (IsWalletProductionEnabled()) |
43 return GURL(kProdWalletServiceUrl); | 42 return GURL(kProdWalletServiceUrl); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 url.host() == final_url.host() && | 138 url.host() == final_url.host() && |
140 url.path() == final_url.path(); | 139 url.path() == final_url.path(); |
141 } | 140 } |
142 | 141 |
143 bool IsUsingProd() { | 142 bool IsUsingProd() { |
144 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); | 143 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); |
145 } | 144 } |
146 | 145 |
147 } // namespace wallet | 146 } // namespace wallet |
148 } // namespace autofill | 147 } // namespace autofill |
OLD | NEW |