| 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 26 matching lines...) Expand all Loading... |
| 37 std::string sandbox_enabled( | 37 std::string sandbox_enabled( |
| 38 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); | 38 command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); |
| 39 if (!sandbox_enabled.empty()) | 39 if (!sandbox_enabled.empty()) |
| 40 return sandbox_enabled != "1"; | 40 return sandbox_enabled != "1"; |
| 41 | 41 |
| 42 // Default to sandbox when --reduce-security-for-testing is passed to allow | 42 // Default to sandbox when --reduce-security-for-testing is passed to allow |
| 43 // rAc on http:// pages. | 43 // rAc on http:// pages. |
| 44 if (command_line->HasSwitch(::switches::kReduceSecurityForTesting)) | 44 if (command_line->HasSwitch(::switches::kReduceSecurityForTesting)) |
| 45 return false; | 45 return false; |
| 46 | 46 |
| 47 // TODO(estade): add a build-time flag for Chromium distros to enable this | 47 #if defined(ENABLE_PROD_WALLET_SERVICE) |
| 48 // rather than checking for an official build. http://crbug.com/334088 | |
| 49 #if defined(GOOGLE_CHROME_BUILD) | |
| 50 // Default to prod for official builds. | |
| 51 return true; | 48 return true; |
| 52 #else | 49 #else |
| 53 // Unofficial builds don't have the proper API keys for production Wallet | |
| 54 // servers. | |
| 55 return false; | 50 return false; |
| 56 #endif | 51 #endif |
| 57 } | 52 } |
| 58 | 53 |
| 59 GURL GetWalletHostUrl() { | 54 GURL GetWalletHostUrl() { |
| 60 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 55 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 61 std::string wallet_service_hostname = | 56 std::string wallet_service_hostname = |
| 62 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); | 57 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); |
| 63 if (!wallet_service_hostname.empty()) | 58 if (!wallet_service_hostname.empty()) |
| 64 return GURL(wallet_service_hostname); | 59 return GURL(wallet_service_hostname); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 false) || | 197 false) || |
| 203 IsSignInContinueUrl(url, &unused); | 198 IsSignInContinueUrl(url, &unused); |
| 204 } | 199 } |
| 205 | 200 |
| 206 bool IsUsingProd() { | 201 bool IsUsingProd() { |
| 207 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); | 202 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); |
| 208 } | 203 } |
| 209 | 204 |
| 210 } // namespace wallet | 205 } // namespace wallet |
| 211 } // namespace autofill | 206 } // namespace autofill |
| OLD | NEW |