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

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

Issue 2815623004: Use common URL emphasizer for web payments. (Closed)
Patch Set: Rebase on top of master Created 3 years, 8 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/ui/PaymentRequestUI.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
index 60fa1684804662d095e0c32e4ef738ede61154f7..f8272db114fd77217a409f2b73b06a441a253efa 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
@@ -361,15 +361,16 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
* @param title The title to show at the top of the UI. This can be, for example, the
* <title> of the merchant website. If the string is too long for
* UI, it elides at the end.
- * @param origin The origin (part of URL) to show under the title. For example,
- * "https://shop.momandpop.com". If the origin is too long for the UI, it
- * should elide according to:
+ * @param origin The origin (https://tools.ietf.org/html/rfc6454) to show under the
+ * title. For example, "https://shop.momandpop.com". If the origin is too
+ * long for the UI, it should elide according to:
* https://www.chromium.org/Home/chromium-security/enamel#TOC-Eliding-Origin-Names-And-Hostnames
+ * @param securityLevel The security level of the page that invoked PaymentRequest.
* @param shippingStrings The string resource identifiers to use in the shipping sections.
*/
public PaymentRequestUI(Activity activity, Client client, boolean requestShipping,
boolean requestContact, boolean canAddCards, boolean showDataSource, String title,
- String origin, ShippingStrings shippingStrings) {
+ String origin, int securityLevel, ShippingStrings shippingStrings) {
mContext = activity;
mClient = client;
mRequestShipping = requestShipping;
@@ -380,7 +381,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
mErrorView = (PaymentRequestUiErrorView) LayoutInflater.from(mContext).inflate(
R.layout.payment_request_error, null);
- mErrorView.initialize(title, origin);
+ mErrorView.initialize(title, origin, securityLevel);
mReadyToPayNotifierForTest = new NotifierForTest(new Runnable() {
@Override
@@ -419,7 +420,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
mRequestView =
(ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.payment_request, null);
- prepareRequestView(mContext, title, origin, canAddCards);
+ prepareRequestView(mContext, title, origin, securityLevel, canAddCards);
// To handle the specced animations, the dialog is entirely contained within a translucent
// FrameLayout. This could eventually be converted to a real BottomSheetDialog, but that
@@ -494,13 +495,14 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
* TODO(dfalcantara): Ideally, everything related to the request and its views would just be put
* into its own class but that'll require yanking out a lot of this class.
*
- * @param context The application context.
- * @param title Title of the page.
- * @param origin Host of the page.
- * @param canAddCards Whether new cards can be added.
+ * @param context The application context.
+ * @param title Title of the page.
+ * @param origin The RFC6454 origin of the page.
+ * @param securityLevel The security level of the page that invoked PaymentRequest.
+ * @param canAddCards Whether new cards can be added.
*/
private void prepareRequestView(
- Context context, String title, String origin, boolean canAddCards) {
+ Context context, String title, String origin, int securityLevel, boolean canAddCards) {
mSpinnyLayout = mRequestView.findViewById(R.id.payment_request_spinny);
assert mSpinnyLayout.getVisibility() == View.VISIBLE;
mIsShowingSpinner = true;
@@ -510,7 +512,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
messageView.setText(R.string.payments_loading_message);
((PaymentRequestHeader) mRequestView.findViewById(R.id.header))
- .setTitleAndOrigin(title, origin);
+ .setTitleAndOrigin(title, origin, securityLevel);
// Set up the buttons.
mCloseButton = mRequestView.findViewById(R.id.close_button);

Powered by Google App Engine
This is Rietveld 408576698