Commit e8546646 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[PRImpl] Rename & moving in ComponentPaymentRequestImpl

Change:
* Rename teardown() to close(). "Teardown" was named because CPRImpl
used to implement PR#close. Now that MojoPaymentRequestGateKeeper has
taken over the PR#close implementation, CPRImpl can use "close" now.
CPRImpl#close is consistent in meaning with PaymentRequestImpl#close.
* Move BrowserPaymentRequestFactory from CPRImpl to
BrowserPaymentRequest, and it get renamed as Factory because now it's
in BrowserPaymentRequest's context.

Bug: 1102522

Change-Id: I47926eaa0a394d0698c1704823ba428e9abe4766
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348542
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797850}
parent bab55bde
...@@ -1701,7 +1701,7 @@ public class PaymentRequestImpl ...@@ -1701,7 +1701,7 @@ public class PaymentRequestImpl
mHasClosed = true; mHasClosed = true;
assert mComponentPaymentRequestImpl != null; assert mComponentPaymentRequestImpl != null;
mComponentPaymentRequestImpl.teardown(); mComponentPaymentRequestImpl.close();
mComponentPaymentRequestImpl = null; mComponentPaymentRequestImpl = null;
closeUIAndDestroyNativeObjects(); closeUIAndDestroyNativeObjects();
......
...@@ -6,6 +6,7 @@ package org.chromium.components.payments; ...@@ -6,6 +6,7 @@ package org.chromium.components.payments;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import org.chromium.content_public.browser.RenderFrameHost;
import org.chromium.payments.mojom.PaymentDetails; import org.chromium.payments.mojom.PaymentDetails;
import org.chromium.payments.mojom.PaymentMethodData; import org.chromium.payments.mojom.PaymentMethodData;
import org.chromium.payments.mojom.PaymentOptions; import org.chromium.payments.mojom.PaymentOptions;
...@@ -17,6 +18,23 @@ import org.chromium.payments.mojom.PaymentValidationErrors; ...@@ -17,6 +18,23 @@ import org.chromium.payments.mojom.PaymentValidationErrors;
* Android Chrome browser or the WebLayer "browser". * Android Chrome browser or the WebLayer "browser".
*/ */
public interface BrowserPaymentRequest { public interface BrowserPaymentRequest {
/** The factory that creates an instance of {@link BrowserPaymentRequest}. */
interface Factory {
/**
* Create an instance of {@link BrowserPaymentRequest}.
* @param renderFrameHost The RenderFrameHost of the merchant page.
* @param componentPaymentRequestImpl The ComponentPaymentRequestImpl to work together with
* the BrowserPaymentRequest instance.
* @param isOffTheRecord Whether the merchant page is in an OffTheRecord (e.g., incognito,
* guest mode) Tab.
* @param journeyLogger The logger that records the user journey of PaymentRequest.
* @return An instance of BrowserPaymentRequest, cannot be null.
*/
BrowserPaymentRequest createBrowserPaymentRequest(RenderFrameHost renderFrameHost,
ComponentPaymentRequestImpl componentPaymentRequestImpl, boolean isOffTheRecord,
JourneyLogger journeyLogger);
}
/** /**
* Initialize the browser part of the {@link PaymentRequest} implementation and validate the raw * Initialize the browser part of the {@link PaymentRequest} implementation and validate the raw
* payment request data coming from the untrusted mojo. * payment request data coming from the untrusted mojo.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment