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

[ExpandablePaymentHandler] Always show security icon

Before:
* When the payment app security was neutral, the security icon was empty.
* The initial security icon was empty.
* The initial content description of the security icon was empty.

After:
* When the payment app security is neutral, the security icon shows
"R.drawable.omnibox_info".
* The initial security icon is "R.drawable.omnibox_info".
* The initial content description of the security icon is "Your
connection to this site is not secure. Site information"

Change:
* Change the initial security icon and its content description to align
with PageInfo's.
* Change the security-neutral security icon to align with omnibox's and
CCT PH's.

Bug: 1091334

Change-Id: If9fbcba624da4375b5ddb3100eb2a6a1363d6205
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2231705
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776246}
parent 65c4a779
......@@ -60,14 +60,18 @@ public class PaymentHandlerToolbarCoordinator implements PaymentHandlerToolbarMe
assert url != null;
mWebContents = webContents;
mActivity = context;
PropertyModel model = new PropertyModel.Builder(PaymentHandlerToolbarProperties.ALL_KEYS)
.with(PaymentHandlerToolbarProperties.PROGRESS_VISIBLE, true)
.with(PaymentHandlerToolbarProperties.LOAD_PROGRESS,
PaymentHandlerToolbarMediator.MINIMUM_LOAD_PROGRESS)
.with(PaymentHandlerToolbarProperties.SECURITY_ICON,
ConnectionSecurityLevel.NONE)
.with(PaymentHandlerToolbarProperties.URL, url)
.build();
int defaultSecurityLevel = ConnectionSecurityLevel.NONE;
PropertyModel model =
new PropertyModel.Builder(PaymentHandlerToolbarProperties.ALL_KEYS)
.with(PaymentHandlerToolbarProperties.PROGRESS_VISIBLE, true)
.with(PaymentHandlerToolbarProperties.LOAD_PROGRESS,
PaymentHandlerToolbarMediator.MINIMUM_LOAD_PROGRESS)
.with(PaymentHandlerToolbarProperties.SECURITY_ICON,
getSecurityIconResource(defaultSecurityLevel))
.with(PaymentHandlerToolbarProperties.SECURITY_ICON_CONTENT_DESCRIPTION,
getSecurityIconContentDescription(defaultSecurityLevel))
.with(PaymentHandlerToolbarProperties.URL, url)
.build();
mIsSmallDevice = !DeviceFormFactor.isNonMultiDisplayContextOnTablet(context);
mMediator = new PaymentHandlerToolbarMediator(model, webContents, /*delegate=*/this);
mToolbarView =
......@@ -116,7 +120,7 @@ public class PaymentHandlerToolbarCoordinator implements PaymentHandlerToolbarMe
public int getSecurityIconResource(@ConnectionSecurityLevel int securityLevel) {
return SecurityStatusIcon.getSecurityIconResource(securityLevel,
SecurityStateModel.shouldShowDangerTriangleForWarningLevel(), mIsSmallDevice,
/*skipIconForNeutralState=*/true);
/*skipIconForNeutralState=*/false);
}
// Implement PaymentHandlerToolbarMediatorDelegate.
......
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