Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: components/autofill/content/browser/wallet/wallet_service_url.cc

Issue 25127002: Use production Wallet service URL by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "components/autofill/core/common/autofill_switches.h" 11 #include "components/autofill/core/common/autofill_switches.h"
12 #include "google_apis/gaia/gaia_urls.h" 12 #include "google_apis/gaia/gaia_urls.h"
13 #include "net/base/url_util.h" 13 #include "net/base/url_util.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 namespace autofill { 16 namespace autofill {
17 namespace { 17 namespace {
18 18
19 const char kProdWalletServiceUrl[] = "https://wallet.google.com/"; 19 const char kProdWalletServiceUrl[] = "https://wallet.google.com/";
20 20
21 // TODO(ahutter): Remove this once production is ready. 21 // TODO(ahutter): Remove this once production is ready.
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::kWalletServiceUseSandbox);
32 base::FieldTrialList::FindFullName("WalletProductionService") == "Yes";
33 } 32 }
34 33
35 GURL GetWalletHostUrl() { 34 GURL GetWalletHostUrl() {
36 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 35 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
37 std::string wallet_service_hostname = 36 std::string wallet_service_hostname =
38 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); 37 command_line.GetSwitchValueASCII(switches::kWalletServiceUrl);
39 if (!wallet_service_hostname.empty()) 38 if (!wallet_service_hostname.empty())
40 return GURL(wallet_service_hostname); 39 return GURL(wallet_service_hostname);
41 if (IsWalletProductionEnabled()) 40 if (IsWalletProductionEnabled())
42 return GURL(kProdWalletServiceUrl); 41 return GURL(kProdWalletServiceUrl);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 url.host() == final_url.host() && 139 url.host() == final_url.host() &&
141 url.path() == final_url.path(); 140 url.path() == final_url.path();
142 } 141 }
143 142
144 bool IsUsingProd() { 143 bool IsUsingProd() {
145 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl); 144 return GetWalletHostUrl() == GURL(kProdWalletServiceUrl);
146 } 145 }
147 146
148 } // namespace wallet 147 } // namespace wallet
149 } // namespace autofill 148 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698