diff --git a/firefox-ios/Client/Frontend/Browser/TabTrayButtonExtensions.swift b/firefox-ios/Client/Frontend/Browser/TabTrayButtonExtensions.swift index fbb2ef72b600..a353a16fe4de 100644 --- a/firefox-ios/Client/Frontend/Browser/TabTrayButtonExtensions.swift +++ b/firefox-ios/Client/Frontend/Browser/TabTrayButtonExtensions.swift @@ -10,7 +10,6 @@ class PrivateModeButton: ToggleButton, PrivateModeUI { override init(frame: CGRect) { super.init(frame: frame) accessibilityLabel = .TabTrayToggleAccessibilityLabel - accessibilityHint = .TabTrayToggleAccessibilityHint let maskImage = UIImage(named: StandardImageIdentifiers.Large.privateMode)? .withRenderingMode(.alwaysTemplate) setImage(maskImage, for: []) diff --git a/firefox-ios/Client/Frontend/Browser/Toolbars/Models/AddressToolbarContainerModel.swift b/firefox-ios/Client/Frontend/Browser/Toolbars/Models/AddressToolbarContainerModel.swift index 12c2754c1f0a..3406d6ee9219 100644 --- a/firefox-ios/Client/Frontend/Browser/Toolbars/Models/AddressToolbarContainerModel.swift +++ b/firefox-ios/Client/Frontend/Browser/Toolbars/Models/AddressToolbarContainerModel.swift @@ -12,6 +12,7 @@ class AddressToolbarContainerModel: Equatable { let browserActions: [ToolbarElement] let borderPosition: AddressToolbarBorderPosition? + let searchEngineName: String? let searchEngineImage: UIImage? let searchEngines: SearchEngines let lockIconImageName: String? @@ -31,9 +32,12 @@ class AddressToolbarContainerModel: Equatable { let locationViewState = LocationViewState( searchEngineImageViewA11yId: AccessibilityIdentifiers.Browser.AddressToolbar.searchEngine, - searchEngineImageViewA11yLabel: .AddressToolbar.PrivacyAndSecuritySettingsA11yLabel, + searchEngineImageViewA11yLabel: String( + format: .AddressToolbar.SearchEngineA11yLabel, + searchEngineName ?? "" + ), lockIconButtonA11yId: AccessibilityIdentifiers.Browser.AddressToolbar.lockIcon, - lockIconButtonA11yLabel: .AddressToolbar.SearchEngineA11yLabel, + lockIconButtonA11yLabel: .AddressToolbar.PrivacyAndSecuritySettingsA11yLabel, urlTextFieldPlaceholder: .AddressToolbar.LocationPlaceholder, urlTextFieldA11yId: AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField, urlTextFieldA11yLabel: .AddressToolbar.LocationA11yLabel, @@ -79,6 +83,7 @@ class AddressToolbarContainerModel: Equatable { isShowingTopTabs: state.isShowingTopTabs, windowUUID: windowUUID) self.windowUUID = windowUUID + self.searchEngineName = profile.searchEngines.defaultEngine?.shortName self.searchEngineImage = profile.searchEngines.defaultEngine?.image self.searchEngines = profile.searchEngines self.lockIconImageName = state.addressToolbar.lockIconImageName diff --git a/firefox-ios/Client/Frontend/Home/LogoHeader/HomepageHeaderCell.swift b/firefox-ios/Client/Frontend/Home/LogoHeader/HomepageHeaderCell.swift index a0dab27072a4..aac1cc97cbf8 100644 --- a/firefox-ios/Client/Frontend/Home/LogoHeader/HomepageHeaderCell.swift +++ b/firefox-ios/Client/Frontend/Home/LogoHeader/HomepageHeaderCell.swift @@ -54,7 +54,6 @@ class HomepageHeaderCell: UICollectionViewCell, ReusableCell, ThemeApplicable { button.layer.cornerRadius = button.frame.size.width / 2 button.addTarget(self, action: #selector(self?.switchMode), for: .touchUpInside) button.accessibilityLabel = .TabTrayToggleAccessibilityLabel - button.accessibilityHint = .TabTrayToggleAccessibilityHint button.accessibilityIdentifier = AccessibilityIdentifiers.FirefoxHomepage.OtherButtons.privateModeToggleButton } @@ -115,5 +114,8 @@ class HomepageHeaderCell: UICollectionViewCell, ReusableCell, ThemeApplicable { let privateModeButtonTintColor = viewModel.isPrivate ? theme.colors.layer2 : theme.colors.iconPrimary privateModeButton.imageView?.tintColor = privateModeButtonTintColor privateModeButton.backgroundColor = viewModel.isPrivate ? .white : .clear + privateModeButton.accessibilityValue = viewModel.isPrivate ? + .TabTrayToggleAccessibilityValueOn : + .TabTrayToggleAccessibilityValueOff } } diff --git a/firefox-ios/Client/Frontend/Strings.swift b/firefox-ios/Client/Frontend/Strings.swift index 93e2eeb2ce1a..76baa4d554ac 100644 --- a/firefox-ios/Client/Frontend/Strings.swift +++ b/firefox-ios/Client/Frontend/Strings.swift @@ -6371,11 +6371,6 @@ extension String { tableName: "PrivateBrowsing", value: "Private browsing", comment: "Accessibility label for toggling on/off private mode") - public static let TabTrayToggleAccessibilityHint = MZLocalizedString( - key: "Turns private mode on or off", - tableName: "PrivateBrowsing", - value: nil, - comment: "Accessiblity hint for toggling on/off private mode") public static let TabTrayToggleAccessibilityValueOn = MZLocalizedString( key: "On", tableName: "PrivateBrowsing", @@ -7393,6 +7388,11 @@ extension String { tableName: "PrivateBrowsing", value: nil, comment: "Accessibility label for toggling on/off private mode") + public static let TabTrayToggleAccessibilityHint = MZLocalizedString( + key: "Turns private mode on or off", + tableName: "PrivateBrowsing", + value: nil, + comment: "Accessiblity hint for toggling on/off private mode") } } }