| Index: chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivityLocationBarLayout.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivityLocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivityLocationBarLayout.java
|
| index d16e3d00d0f5995f136b9a4237683edf9a2b3e2c..995ffa48db9cfa6ee44a93f5ed59a1b5d89fad45 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivityLocationBarLayout.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivityLocationBarLayout.java
|
| @@ -13,9 +13,12 @@ import android.view.View;
|
| import org.chromium.chrome.R;
|
| import org.chromium.chrome.browser.locale.LocaleManager;
|
| import org.chromium.chrome.browser.omnibox.LocationBarLayout;
|
| +import org.chromium.chrome.browser.omnibox.OmniboxSuggestion;
|
| import org.chromium.chrome.browser.profiles.Profile;
|
| import org.chromium.ui.UiUtils;
|
|
|
| +import java.util.List;
|
| +
|
| /** Implementation of the {@link LocationBarLayout} that is displayed for widget searches. */
|
| public class SearchActivityLocationBarLayout extends LocationBarLayout {
|
| /** Delegates calls out to the containing Activity. */
|
| @@ -28,10 +31,12 @@ public class SearchActivityLocationBarLayout extends LocationBarLayout {
|
| }
|
|
|
| private Delegate mDelegate;
|
| + private boolean mShowSuggestions;
|
|
|
| public SearchActivityLocationBarLayout(Context context, AttributeSet attrs) {
|
| super(context, attrs, R.layout.location_bar_base);
|
| setUrlBarFocusable(true);
|
| + mShowSuggestions = !LocaleManager.getInstance().needToCheckForSearchEnginePromo();
|
| }
|
|
|
| /** Set the {@link Delegate}. */
|
| @@ -65,6 +70,14 @@ public class SearchActivityLocationBarLayout extends LocationBarLayout {
|
| super.onNativeLibraryReady();
|
| setAutocompleteProfile(Profile.getLastUsedProfile().getOriginalProfile());
|
| setShowCachedZeroSuggestResults(true);
|
| + mShowSuggestions = !LocaleManager.getInstance().needToCheckForSearchEnginePromo();
|
| + }
|
| +
|
| + @Override
|
| + public void onSuggestionsReceived(
|
| + List<OmniboxSuggestion> newSuggestions, String inlineAutocompleteText) {
|
| + if (!mShowSuggestions) return;
|
| + super.onSuggestionsReceived(newSuggestions, inlineAutocompleteText);
|
| }
|
|
|
| /** Called when the SearchActivity has finished initialization. */
|
| @@ -72,6 +85,7 @@ public class SearchActivityLocationBarLayout extends LocationBarLayout {
|
| SearchWidgetProvider.updateCachedVoiceSearchAvailability(isVoiceSearchEnabled());
|
| if (isVoiceSearchIntent && mUrlBar.isFocused()) onUrlFocusChange(true);
|
| if (!TextUtils.isEmpty(mUrlBar.getText())) onTextChangedForAutocomplete();
|
| + mShowSuggestions = true;
|
| }
|
|
|
| /** Begins a new query. */
|
|
|