Commit 09932bf9 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Force a omnibox refocus on the NTP to update accessibility focus bounds.

Android does not seem to monitor size changes and update the bounds
correctly, so this forces the update after the animation completes.

BUG=595664

Change-Id: I5b3d8b4d62582929699603bd6fff751d0677f82b
Reviewed-on: https://chromium-review.googlesource.com/c/1372306Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615617}
parent b1041214
...@@ -55,6 +55,7 @@ import org.chromium.chrome.browser.tab.Tab; ...@@ -55,6 +55,7 @@ import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider; import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
import org.chromium.chrome.browser.toolbar.ToolbarManager; import org.chromium.chrome.browser.toolbar.ToolbarManager;
import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback; import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback;
import org.chromium.chrome.browser.util.AccessibilityUtil;
import org.chromium.chrome.browser.util.ColorUtils; import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.DeviceFormFactor;
...@@ -381,6 +382,15 @@ public class LocationBarLayout extends FrameLayout ...@@ -381,6 +382,15 @@ public class LocationBarLayout extends FrameLayout
} }
if (!inProgress) { if (!inProgress) {
// The accessibility bounding box is not properly updated when focusing the Omnibox
// from the NTP fakebox. Clearing/re-requesting focus triggers the bounding box to
// be recalculated.
if (didFocusUrlFromFakebox() && !inProgress && mUrlHasFocus
&& AccessibilityUtil.isAccessibilityEnabled()) {
mUrlBar.clearFocus();
mUrlBar.requestFocus();
}
for (UrlFocusChangeListener listener : mUrlFocusChangeListeners) { for (UrlFocusChangeListener listener : mUrlFocusChangeListeners) {
listener.onUrlAnimationFinished(mUrlHasFocus); listener.onUrlAnimationFinished(mUrlHasFocus);
} }
......
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