Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #1963, #1964 - Icon not showing in the URL bar and alignment bein…
Browse files Browse the repository at this point in the history
…g far off
  • Loading branch information
Brandon-T committed Feb 14, 2020
1 parent 51541de commit 85ca98c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1256,9 +1256,9 @@ class BrowserViewController: UIViewController {
}

tab.contentIsSecure = false
topToolbar.contentIsSecure = tab.contentIsSecure


guard let serverTrust = tab.webView?.serverTrust else {
topToolbar.contentIsSecure = tab.contentIsSecure
break
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ class OnboardingWebViewController: UIViewController, WKNavigationDelegate {
if let trust = webView.serverTrust {
toolbar.secureIcon.isHidden = false

let x509 = SecPolicyCreateBasicX509()
let sslPolicy = SecPolicyCreateSSL(true, (webView.url?.host ?? "") as CFString)
SecTrustSetPolicies(trust, [x509, sslPolicy] as CFTypeRef)
let policies = [
SecPolicyCreateBasicX509(),
SecPolicyCreateSSL(true, webView.url?.host as CFString?)
]

SecTrustSetPolicies(trust, policies as CFTypeRef)

var result: SecTrustResultType = .invalid
SecTrustEvaluate(trust, &result)
Expand Down
13 changes: 6 additions & 7 deletions Client/Frontend/Browser/Toolbars/UrlBar/TabLocationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ class TabLocationView: UIView {
}

private func updateLockImageView() {
let wasHidden = lockImageView.isHidden
lockImageView.isHidden = !contentIsSecure

if wasHidden != lockImageView.isHidden {
UIAccessibility.post(notification: .layoutChanged, argument: nil)
if contentIsSecure {
lockImageView.tintColor = #colorLiteral(red: 0, green: 0.6860338449, blue: 0, alpha: 1)
} else {
lockImageView.tintColor = .red
}
}

Expand Down Expand Up @@ -138,7 +137,7 @@ class TabLocationView: UIView {

fileprivate lazy var lockImageView: UIImageView = {
let lockImageView = UIImageView(image: #imageLiteral(resourceName: "lock_verified").template)
lockImageView.isHidden = true // Hidden by default
lockImageView.isHidden = false
lockImageView.tintColor = #colorLiteral(red: 0.3764705882, green: 0.3843137255, blue: 0.4, alpha: 1)
lockImageView.isAccessibilityElement = true
lockImageView.contentMode = .center
Expand Down Expand Up @@ -400,7 +399,7 @@ extension TabLocationView: TabEventHandler {
class DisplayTextField: UITextField {
weak var accessibilityActionsSource: AccessibilityActionsSource?
var hostString: String = ""
let pathPadding: CGFloat = 20.0
let pathPadding: CGFloat = 5.0

override var accessibilityCustomActions: [UIAccessibilityCustomAction]? {
get {
Expand Down

0 comments on commit 85ca98c

Please sign in to comment.