Skip to content

Commit

Permalink
Remove share button code from the Toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Amin authored and Sophie Amin committed May 8, 2024
1 parent 002149b commit 278380c
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ protocol TabLocationViewDelegate: AnyObject {
func tabLocationViewDidTapReload(_ tabLocationView: TabLocationView)
func tabLocationViewDidTapShield(_ tabLocationView: TabLocationView)
func tabLocationViewDidBeginDragInteraction(_ tabLocationView: TabLocationView)
func tabLocationViewDidTapShare(_ tabLocationView: TabLocationView, button: UIButton)
func tabLocationViewPresentCFR(at sourceView: UIView)

/// - returns: whether the long-press was handled by the delegate; i.e. return `false` when the conditions
Expand Down Expand Up @@ -66,7 +65,6 @@ class TabLocationView: UIView, FeatureFlaggable {
didSet {
hideButtons()
updateTextWithURL()
shareButton.isHidden = !isValidHttpUrlProtocol(url)
setNeedsUpdateConstraints()
showTrackingProtectionButton(for: url)
}
Expand Down Expand Up @@ -122,17 +120,6 @@ class TabLocationView: UIView, FeatureFlaggable {
trackingProtectionButton.accessibilityLabel = .TabLocationLockButtonAccessibilityLabel
}

lazy var shareButton: ShareButton = .build { shareButton in
shareButton.addTarget(self, action: #selector(self.didPressShareButton(_:)), for: .touchUpInside)
shareButton.clipsToBounds = false
shareButton.contentHorizontalAlignment = .center
shareButton.accessibilityIdentifier = AccessibilityIdentifiers.Toolbar.shareButton
shareButton.accessibilityLabel = .TabLocationShareAccessibilityLabel
shareButton.showsLargeContentViewer = true
shareButton.largeContentImage = .templateImageNamed(StandardImageIdentifiers.Large.shareApple)
shareButton.largeContentTitle = .TabLocationShareButtonLargeContentTitle
}

private lazy var shoppingButton: UIButton = .build { button in
let image = UIImage(named: StandardImageIdentifiers.Large.shopping)

Expand Down Expand Up @@ -212,7 +199,6 @@ class TabLocationView: UIView, FeatureFlaggable {
urlTextField,
shoppingButton,
readerModeButton,
shareButton,
reloadButton
]
contentView = UIStackView(arrangedSubviews: subviews)
Expand All @@ -229,8 +215,6 @@ class TabLocationView: UIView, FeatureFlaggable {
shoppingButton.heightAnchor.constraint(equalToConstant: UX.buttonSize),
readerModeButton.widthAnchor.constraint(equalToConstant: UX.buttonSize),
readerModeButton.heightAnchor.constraint(equalToConstant: UX.buttonSize),
shareButton.heightAnchor.constraint(equalToConstant: UX.buttonSize),
shareButton.widthAnchor.constraint(equalToConstant: UX.buttonSize),
reloadButton.widthAnchor.constraint(equalToConstant: UX.buttonSize),
reloadButton.heightAnchor.constraint(equalToConstant: UX.buttonSize),
])
Expand All @@ -255,7 +239,6 @@ class TabLocationView: UIView, FeatureFlaggable {
urlTextField,
shoppingButton,
readerModeButton,
shareButton,
reloadButton
]

Expand Down Expand Up @@ -317,11 +300,6 @@ class TabLocationView: UIView, FeatureFlaggable {
delegate?.tabLocationViewDidTapShield(self)
}

@objc
func didPressShareButton(_ button: UIButton) {
delegate?.tabLocationViewDidTapShare(self, button: shareButton)
}

@objc
func didPressShoppingButton(_ button: UIButton) {
button.isSelected = true
Expand Down Expand Up @@ -438,7 +416,7 @@ class TabLocationView: UIView, FeatureFlaggable {

// Fixes: https://github.com/mozilla-mobile/firefox-ios/issues/17403
private func hideButtons() {
[shoppingButton, shareButton].forEach { $0.isHidden = true }
[shoppingButton].forEach { $0.isHidden = true }
}

private func currentTheme() -> Theme {
Expand Down Expand Up @@ -548,7 +526,6 @@ extension TabLocationView: ThemeApplicable {
urlTextField.textColor = theme.colors.textPrimary
readerModeButton.applyTheme(theme: theme)
trackingProtectionButton.applyTheme(theme: theme)
shareButton.applyTheme(theme: theme)
reloadButton.applyTheme(theme: theme)
shoppingButton.tintColor = theme.colors.textPrimary
shoppingButton.setImage(UIImage(named: StandardImageIdentifiers.Large.shopping)?
Expand Down

0 comments on commit 278380c

Please sign in to comment.