Commit 11506514 authored by clairehurst's avatar clairehurst 🌱 Committed by Pier Angelo Vendrame
Browse files

fixup! TB 40015: [android] Port padlock states for .onion services

Bug 45115: Fix site security icon for new toolbar
parent 66a44749
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.ktx.kotlin.applyRegistrableDomainSpan
import mozilla.components.support.ktx.kotlin.getOrigin
import mozilla.components.support.ktx.kotlin.isContentUrl
import mozilla.components.support.ktx.kotlin.isOnionUrl
import mozilla.components.support.ktx.kotlin.isUrl
import mozilla.components.support.ktx.util.URLStringUtils
import mozilla.components.support.utils.ClipboardHandler
@@ -1285,12 +1286,11 @@ class BrowserToolbarMiddleware(
                    testTag = SITE_INFO_UNKNOWN,
                )
            } else if (
                selectedTab.content.securityInfo.isSecure &&
                selectedTab.trackingProtection.enabled &&
                !selectedTab.trackingProtection.ignoredOnTrackingProtection
                selectedTab.content.securityInfo.isSecure
            ) {
                if (selectedTab.content.url.isOnionUrl()) {
                    buildSiteInfoAction(
                    drawableResId = iconsR.drawable.mozac_ic_shield_checkmark_24,
                        drawableResId = iconsR.drawable.mozac_ic_onion,
                        contentDescription = toolbarR.string.mozac_browser_toolbar_content_description_site_info,
                        highlighted = highlight,
                        onClick = StartPageActions.SiteInfoClicked,
@@ -1298,7 +1298,16 @@ class BrowserToolbarMiddleware(
                    )
                } else {
                    buildSiteInfoAction(
                    drawableResId = iconsR.drawable.mozac_ic_shield_slash_24,
                        drawableResId = iconsR.drawable.mozac_ic_lock_24,
                        contentDescription = toolbarR.string.mozac_browser_toolbar_content_description_site_info,
                        highlighted = highlight,
                        onClick = StartPageActions.SiteInfoClicked,
                        testTag = SITE_INFO_SECURE,
                    )
                }
            } else {
                buildSiteInfoAction(
                    drawableResId = iconsR.drawable.mozac_ic_lock_slash_critical_24,
                    contentDescription = toolbarR.string.mozac_browser_toolbar_content_description_site_info,
                    highlighted = highlight,
                    onClick = StartPageActions.SiteInfoClicked,