Commit 17546f7d authored by Mike Pinkerton's avatar Mike Pinkerton Committed by Commit Bot

Don't focus voiceSearch button when VoiceOver is enabled.

BUG=1096303

Change-Id: Ib8ab6c447f11da6ddb37275fed67ec8e2946d141
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405937Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Mike Pinkerton <pinkerton@chromium.org>
Auto-Submit: Mike Pinkerton <pinkerton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806676}
parent 989a76e6
......@@ -340,7 +340,7 @@ const NSString* kScribbleFakeboxElementId = @"fakebox";
[self.headerView.voiceSearchButton addTarget:self
action:@selector(preloadVoiceSearch:)
forControlEvents:UIControlEventTouchDown];
self.headerView.voiceSearchButton.enabled = self.voiceSearchIsEnabled;
[self updateVoiceSearchDisplay];
}
// On NTP in split toolbar mode the omnibox has different location (in the
......@@ -476,6 +476,15 @@ const NSString* kScribbleFakeboxElementId = @"fakebox";
}
}
// Ensures the state of the Voice Search button matches whether or not it's
// enabled. If it's not, disables the button and removes it from the a11y loop
// for VoiceOver.
- (void)updateVoiceSearchDisplay {
self.headerView.voiceSearchButton.enabled = self.voiceSearchIsEnabled;
self.headerView.voiceSearchButton.isAccessibilityElement =
self.voiceSearchIsEnabled;
}
// Adds the constraints for the |logoView|, the |fakeomnibox| related to the
// |headerView|. It also sets the properties constraints related to those views.
- (void)addConstraintsForLogoView:(UIView*)logoView
......@@ -700,7 +709,7 @@ const NSString* kScribbleFakeboxElementId = @"fakebox";
if (_voiceSearchIsEnabled == voiceSearchIsEnabled)
return;
_voiceSearchIsEnabled = voiceSearchIsEnabled;
self.headerView.voiceSearchButton.enabled = _voiceSearchIsEnabled;
[self updateVoiceSearchDisplay];
}
#pragma mark - UserAccountImageUpdateDelegate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment