| 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/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // TODO(ahutter): Remove this once production is ready. | 28 // TODO(ahutter): Remove this once production is ready. |
| 29 const char kSandboxWalletSecureServiceUrl[] = | 29 const char kSandboxWalletSecureServiceUrl[] = |
| 30 "https://wallet-web.sandbox.google.com/"; | 30 "https://wallet-web.sandbox.google.com/"; |
| 31 | 31 |
| 32 bool IsWalletProductionEnabled() { | 32 bool IsWalletProductionEnabled() { |
| 33 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 33 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 34 std::string sandbox_enabled( | 34 std::string sandbox_enabled( |
| 35 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); | 35 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); |
| 36 if (!sandbox_enabled.empty()) | 36 if (!sandbox_enabled.empty()) |
| 37 return sandbox_enabled != "1"; | 37 return sandbox_enabled != "1"; |
| 38 #if defined(OS_MACOSX) | |
| 39 return false; | |
| 40 #else | |
| 41 return true; | 38 return true; |
| 42 #endif | |
| 43 } | 39 } |
| 44 | 40 |
| 45 GURL GetWalletHostUrl() { | 41 GURL GetWalletHostUrl() { |
| 46 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 42 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 47 std::string wallet_service_hostname = | 43 std::string wallet_service_hostname = |
| 48 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); | 44 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); |
| 49 if (!wallet_service_hostname.empty()) | 45 if (!wallet_service_hostname.empty()) |
| 50 return GURL(wallet_service_hostname); | 46 return GURL(wallet_service_hostname); |
| 51 if (IsWalletProductionEnabled()) | 47 if (IsWalletProductionEnabled()) |
| 52 return GURL(kProdWalletServiceUrl); | 48 return GURL(kProdWalletServiceUrl); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 177 |
| 182 return true; | 178 return true; |
| 183 } | 179 } |
| 184 | 180 |
| 185 bool IsUsingProd() { | 181 bool IsUsingProd() { |
| 186 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); | 182 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); |
| 187 } | 183 } |
| 188 | 184 |
| 189 } // namespace wallet | 185 } // namespace wallet |
| 190 } // namespace autofill | 186 } // namespace autofill |
| OLD | NEW |