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

Unified Diff: components/autofill/core/browser/payments/payments_client.cc

Issue 1999923002: Move the Google Payments URL functions out of content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/payments/payments_client.cc
diff --git a/components/autofill/core/browser/payments/payments_client.cc b/components/autofill/core/browser/payments/payments_client.cc
index 367f8c550ac1bae5797a2376ac11d9b69ab08415..af1f092f0271014631ee4ac5765fef0b1a675d62 100644
--- a/components/autofill/core/browser/payments/payments_client.cc
+++ b/components/autofill/core/browser/payments/payments_client.cc
@@ -21,7 +21,7 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/payments/payments_request.h"
-#include "components/autofill/core/common/autofill_switches.h"
+#include "components/autofill/core/browser/payments/payments_service_url.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "google_apis/gaia/identity_provider.h"
#include "net/base/escape.h"
@@ -35,9 +35,6 @@ namespace payments {
namespace {
-const char kPaymentsRequestHost[] = "https://wallet.google.com";
-const char kPaymentsRequestHostSandbox[] = "https://sandbox.google.com";
-
const char kUnmaskCardRequestPath[] =
"payments/apis-secure/creditcardservice/getrealpan?s7e_suffix=chromewallet";
const char kUnmaskCardRequestFormat[] =
@@ -58,24 +55,6 @@ const char kTokenServiceConsumerId[] = "wallet_client";
const char kPaymentsOAuth2Scope[] =
"https://www.googleapis.com/auth/wallet.chrome";
-// This is mostly copied from wallet_service_url.cc, which is currently in
-// content/, hence inaccessible from here.
-bool IsPaymentsProductionEnabled() {
- // If the command line flag exists, it takes precedence.
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- std::string sandbox_enabled(
- command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox));
- if (!sandbox_enabled.empty())
- return sandbox_enabled != "1";
-
-#if defined(ENABLE_PROD_WALLET_SERVICE)
- return true;
-#else
- return false;
-#endif
-}
-
GURL GetRequestUrl(const std::string& path) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch("sync-url")) {
if (IsPaymentsProductionEnabled()) {
@@ -91,9 +70,7 @@ GURL GetRequestUrl(const std::string& path) {
"about:flags.";
}
- GURL base(IsPaymentsProductionEnabled() ? kPaymentsRequestHost
- : kPaymentsRequestHostSandbox);
- return base.Resolve(path);
+ return GetBaseSecureUrl().Resolve(path);
}
std::unique_ptr<base::DictionaryValue> BuildRiskDictionary(

Powered by Google App Engine
This is Rietveld 408576698