Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
| index e83afab71f8f3fc6ef68e1be666f62764b11ab16..3e3ecf84d67f819686f120d84cfd28dd9b4d97e0 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java |
| @@ -497,29 +497,23 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar, |
| mSecurityIconType = securityLevel; |
| + boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext()); |
| boolean isOfflinePage = getCurrentTab() != null && getCurrentTab().isOfflinePage(); |
| - boolean showSecurityButton = securityLevel != ConnectionSecurityLevel.NONE || isOfflinePage; |
| - |
| - if (securityLevel == ConnectionSecurityLevel.NONE) { |
| - if (isOfflinePage && mShowsOfflinePage != isOfflinePage) { |
| - TintedDrawable bolt = TintedDrawable.constructTintedDrawable( |
| - getResources(), R.drawable.offline_pin); |
| - bolt.setTint(mUseDarkColors ? mDarkModeTint : mLightModeTint); |
| - mSecurityButton.setImageDrawable(bolt); |
| - } |
| + |
| + int id = LocationBarLayout.getSecurityIconResource( |
| + securityLevel, isSmallDevice, isOfflinePage); |
| + boolean showSecurityButton = true; |
| + if (id == 0) { |
| + // Hide the button if we don't have an actual icon to display. |
| + showSecurityButton = false; |
| + mSecurityButton.setImageDrawable(null); |
| } else { |
| - boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext()); |
| - int id = LocationBarLayout.getSecurityIconResource(securityLevel, isSmallDevice); |
| - if (id == 0) { |
| - // Hide the button if we don't have an actual icon to display. |
| - showSecurityButton = false; |
| - } else { |
| - // ImageView#setImageResource is no-op if given resource is the current one. |
| - mSecurityButton.setImageResource(id); |
| - mSecurityButton.setTint( |
| - LocationBarLayout.getColorStateList(securityLevel, getToolbarDataProvider(), |
| - getResources(), false /* omnibox is not opaque */)); |
| - } |
| + // ImageView#setImageResource is no-op if given resource is the current one. |
| + mSecurityButton.setImageResource(id); |
| + mSecurityButton.setTint( |
| + LocationBarLayout.getColorStateList(securityLevel, getToolbarDataProvider(), |
| + getResources(), ColorUtils.shouldUseOpaqueTextboxBackground( |
|
Ted C
2016/10/24 17:19:45
why the change for the last param? we never show
fgorski
2016/10/24 22:34:14
For some reason when testing it on Friday I saw im
|
| + getToolbarDataProvider().getPrimaryColor()))); |
| } |
| mShowsOfflinePage = isOfflinePage; |