diff options
author | ahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-27 08:44:04 +0000 |
---|---|---|
committer | ahutter@chromium.org <ahutter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-27 08:44:04 +0000 |
commit | d0c71763ea2cf670a732c9d052e8ea4707fdc8b0 (patch) | |
tree | 87f60a48b8782a067c4e2fd5a5f005d15850045a | |
parent | d707fdef095589dda221af41f522bd1a423ed294 (diff) | |
download | chromium_src-d0c71763ea2cf670a732c9d052e8ea4707fdc8b0.zip chromium_src-d0c71763ea2cf670a732c9d052e8ea4707fdc8b0.tar.gz chromium_src-d0c71763ea2cf670a732c9d052e8ea4707fdc8b0.tar.bz2 |
Setting up Finch trial for using production Wallet service.
BUG=223293
Review URL: https://chromiumcodereview.appspot.com/12869014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190864 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | components/autofill/browser/wallet/wallet_service_url.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/components/autofill/browser/wallet/wallet_service_url.cc b/components/autofill/browser/wallet/wallet_service_url.cc index 7e6876e..5e27a27 100644 --- a/components/autofill/browser/wallet/wallet_service_url.cc +++ b/components/autofill/browser/wallet/wallet_service_url.cc @@ -7,6 +7,7 @@ #include <string> #include "base/command_line.h" +#include "base/metrics/field_trial.h" #include "components/autofill/common/autofill_switches.h" #include "google_apis/gaia/gaia_urls.h" #include "googleurl/src/gurl.h" @@ -24,13 +25,19 @@ const char kSandboxWalletServiceUrl[] = const char kSandboxWalletSecureServiceUrl[] = "https://wallet-web.sandbox.google.com/"; +bool IsWalletProductionEnabled() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + return command_line.HasSwitch(switches::kWalletServiceUseProd) || + base::FieldTrialList::FindFullName("WalletProductionService") == "Yes"; +} + GURL GetWalletHostUrl() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); std::string wallet_service_hostname = command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); if (!wallet_service_hostname.empty()) return GURL(wallet_service_hostname); - if (command_line.HasSwitch(switches::kWalletServiceUseProd)) + if (IsWalletProductionEnabled()) return GURL(kProdWalletServiceUrl); return GURL(kSandboxWalletServiceUrl); } @@ -49,7 +56,7 @@ GURL GetBaseSecureUrl() { command_line.GetSwitchValueASCII(switches::kWalletSecureServiceUrl); if (!wallet_secure_url.empty()) return GURL(wallet_secure_url); - if (command_line.HasSwitch(switches::kWalletServiceUseProd)) + if (IsWalletProductionEnabled()) return GURL(kProdWalletServiceUrl); return GURL(kSandboxWalletSecureServiceUrl); } @@ -90,7 +97,7 @@ GURL GetPassiveAuthUrl() { GURL GetEncryptionUrl() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); // TODO(ahutter): Stop checking these switches once we switch over to prod. - if (command_line.HasSwitch(switches::kWalletServiceUseProd) || + if (IsWalletProductionEnabled() || command_line.HasSwitch(switches::kWalletServiceUrl)) { return GetWalletHostUrl().Resolve( "online-secure/temporarydata/cvv?s7e=cvv"); @@ -103,7 +110,7 @@ GURL GetEncryptionUrl() { GURL GetEscrowUrl() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); // TODO(ahutter): Stop checking these switches once we switch over to prod. - if (command_line.HasSwitch(switches::kWalletServiceUseProd) || + if (IsWalletProductionEnabled() || command_line.HasSwitch(switches::kWalletServiceUrl)) { return GetBaseSecureUrl().Resolve("dehEfe?s7e=cardNumber%3Bcvv"); } else { |