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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2739033004: Send origin of the iframe browsing context (Closed)
Patch Set: Standalone Created 3 years, 9 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: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index bc8f617aa6c64756986dd2d1370fc75a1f6e40df..8b26ffc146a3cf48023819e6bcc9bb95a2626f8e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -252,6 +252,7 @@ public class PaymentRequestImpl
private final WebContents mWebContents;
private final String mSchemelessOriginForPaymentApp;
private final String mOriginForDisplay;
+ private final String mSchemelessIFrameOriginForPaymentApp;
private final String mMerchantName;
private final byte[][] mCertificateChain;
private final AddressEditor mAddressEditor;
@@ -354,6 +355,7 @@ public class PaymentRequestImpl
assert renderFrameHost != null;
mRenderFrameHost = renderFrameHost;
+
mWebContents = WebContentsStatics.fromRenderFrameHost(renderFrameHost);
mSchemelessOriginForPaymentApp = UrlFormatter.formatUrlForSecurityDisplay(
@@ -362,6 +364,9 @@ public class PaymentRequestImpl
mOriginForDisplay = UrlFormatter.formatUrlForSecurityDisplay(
mWebContents.getLastCommittedUrl(), true /* include scheme in display */);
+ mSchemelessIFrameOriginForPaymentApp = UrlFormatter.formatUrlForSecurityDisplay(
+ mRenderFrameHost.getLastCommittedURL(), false /* omit scheme for payment apps. */);
+
mMerchantName = mWebContents.getTitle();
mCertificateChain = CertificateChainHelper.getCertificateChain(mWebContents);
@@ -652,8 +657,8 @@ public class PaymentRequestImpl
// so a fast response from a non-autofill payment app at the front of the app list does not
// cause NOT_SUPPORTED payment rejection.
for (Map.Entry<PaymentApp, Map<String, PaymentMethodData>> q : queryApps.entrySet()) {
- q.getKey().getInstruments(
- q.getValue(), mSchemelessOriginForPaymentApp, mCertificateChain, this);
+ q.getKey().getInstruments(q.getValue(), mSchemelessOriginForPaymentApp,
+ mSchemelessIFrameOriginForPaymentApp, mCertificateChain, this);
}
}
@@ -1175,8 +1180,9 @@ public class PaymentRequestImpl
}
instrument.invokePaymentApp(mMerchantName, mSchemelessOriginForPaymentApp,
- mCertificateChain, Collections.unmodifiableMap(methodData), mRawTotal,
- mRawLineItems, Collections.unmodifiableMap(modifiers), this);
+ mSchemelessIFrameOriginForPaymentApp, mCertificateChain,
+ Collections.unmodifiableMap(methodData), mRawTotal, mRawLineItems,
+ Collections.unmodifiableMap(modifiers), this);
recordSuccessFunnelHistograms("PayClicked");
return !(instrument instanceof AutofillPaymentInstrument);

Powered by Google App Engine
This is Rietveld 408576698