Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java |
| index 2835c612904ac874983f808944c923e87f8e1f31..dba52a053ff25717fd13ebde3ec7b1df78e33803 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java |
| @@ -9,6 +9,7 @@ import android.text.TextUtils; |
| import com.google.common.annotations.VisibleForTesting; |
| import org.chromium.base.CalledByNative; |
| +import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.Type; |
| import org.chromium.chrome.browser.profiles.Profile; |
| import org.chromium.content_public.browser.WebContents; |
| @@ -209,6 +210,14 @@ public class AutocompleteController { |
| @CalledByNative |
| private static void addOmniboxSuggestionToList(List<OmniboxSuggestion> suggestionList, |
| OmniboxSuggestion suggestion) { |
| + // Don't add answer suggestions if their answer contents were malformed and failed to parse |
| + // (and thus populate the answer property). |
| + // TODO(jdonnelly): Land the new type CL before landing this CL then switch to the |
| + // type-based check: |
| + //if (suggestion.getType() == SEARCH_SUGGEST_ANSWER && !suggestion.hasAnswer()) { |
| + if (!TextUtils.isEmpty(suggestion.getAnswerContents()) && !suggestion.hasAnswer()) { |
|
Ted C
2014/06/13 23:54:16
I just remembered that we log selections based on
Justin Donnelly
2014/06/16 19:32:54
Well, on further reflection, maybe fallback is bet
Justin Donnelly
2014/06/17 21:34:03
Per our discussion yesterday, removed this code.
|
| + return; |
| + } |
| suggestionList.add(suggestion); |
| } |