Commit e9d6060f authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Prevent suggestions UI from triggering when de-focusing.

BUG=903879

Change-Id: Ib032d8d0ef9c3b3804c14e79a2c4904f32453c9e
Reviewed-on: https://chromium-review.googlesource.com/c/1330071Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606955}
parent b65b0739
...@@ -490,13 +490,11 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener { ...@@ -490,13 +490,11 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener {
}); });
} }
} else { } else {
// Prevent any upcoming omnibox suggestions from showing once a URL is loaded (and as
// a consequence the omnibox is unfocused).
stopAutocomplete(true);
mCanShowSuggestions = false; mCanShowSuggestions = false;
mHasStartedNewOmniboxEditSession = false; mHasStartedNewOmniboxEditSession = false;
mNewOmniboxEditSessionTimestamp = -1; mNewOmniboxEditSessionTimestamp = -1;
// Prevent any upcoming omnibox suggestions from showing once a URL is loaded (and as
// a consequence the omnibox is unfocused).
hideSuggestions(); hideSuggestions();
mImageFetcher.clearCache(); mImageFetcher.clearCache();
} }
...@@ -815,7 +813,7 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener { ...@@ -815,7 +813,7 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener {
@Override @Override
public void onSuggestionsReceived( public void onSuggestionsReceived(
List<OmniboxSuggestion> newSuggestions, String inlineAutocompleteText) { List<OmniboxSuggestion> newSuggestions, String inlineAutocompleteText) {
if (mShouldPreventOmniboxAutocomplete) return; if (mShouldPreventOmniboxAutocomplete || !mCanShowSuggestions) return;
// This is a callback from a listener that is set up by onNativeLibraryReady, // This is a callback from a listener that is set up by onNativeLibraryReady,
// so can only be called once the native side is set up unless we are showing // so can only be called once the native side is set up unless we are showing
......
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