Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java |
index df24013c098d9e713845e7896ddac29d14350ffc..036b1ac95fef8896b203e5921df748c2f57e7e30 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java |
@@ -34,29 +34,31 @@ public class OmniboxSuggestion { |
* Negative types are specific to Chrome on Android front-end. |
*/ |
public static enum Type { |
- VOICE_SUGGEST (-100), // A suggested search from the voice recognizer. |
- |
- URL_WHAT_YOU_TYPED (0), // The input as a URL. |
- HISTORY_URL (1), // A past page whose URL contains the input. |
- HISTORY_TITLE (2), // A past page whose title contains the input. |
- HISTORY_BODY (3), // A past page whose body contains the input. |
- HISTORY_KEYWORD (4), // A past page whose keyword contains the input. |
- NAVSUGGEST (5), // A suggested URL. |
- SEARCH_WHAT_YOU_TYPED (6), // The input as a search query (with the default |
- // engine). |
- SEARCH_HISTORY (7), // A past search (with the default engine) |
- // containing the input. |
- SEARCH_SUGGEST (8), // A suggested search (with the default engine). |
- SEARCH_SUGGEST_ENTITY (9), // A suggested search for an entity. |
- SEARCH_SUGGEST_INFINITE (10), // A suggested search (with the default engine) |
- // to complete the tail part of the input. |
+ VOICE_SUGGEST (-100), // A suggested search from the voice recognizer. |
+ |
+ URL_WHAT_YOU_TYPED (0), // The input as a URL. |
+ HISTORY_URL (1), // A past page whose URL contains the input. |
+ HISTORY_TITLE (2), // A past page whose title contains the input. |
+ HISTORY_BODY (3), // A past page whose body contains the input. |
+ HISTORY_KEYWORD (4), // A past page whose keyword contains the input. |
+ NAVSUGGEST (5), // A suggested URL. |
+ SEARCH_WHAT_YOU_TYPED (6), // The input as a search query (with the default |
+ // engine). |
+ SEARCH_HISTORY (7), // A past search (with the default engine) |
+ // containing the input. |
+ SEARCH_SUGGEST (8), // A suggested search (with the default engine). |
+ SEARCH_SUGGEST_ENTITY (9), // A suggested search for an entity. |
+ SEARCH_SUGGEST_INFINITE (10), // A suggested search (with the default engine) |
+ // to complete the tail part of the input. |
SEARCH_SUGGEST_PERSONALIZED (11), // A personalized suggested search. |
- SEARCH_SUGGEST_PROFILE (12), // A personalized suggested search for a |
- // Google+ profile. |
- SEARCH_OTHER_ENGINE (13), // A search with a non-default engine. |
- OPEN_HISTORY_PAGE (17), // A synthetic result that opens the history page |
- // to search for the input. |
- SEARCH_SUGGEST_ANSWER (18); // A short result for a suggested search. |
+ SEARCH_SUGGEST_PROFILE (12), // A personalized suggested search for a |
+ // Google+ profile. |
+ SEARCH_OTHER_ENGINE (13), // A search with a non-default engine. |
+ OPEN_HISTORY_PAGE (17), // A synthetic result that opens the history page |
+ // to search for the input. |
+ SEARCH_SUGGEST_ANSWER (18); // DEPRECATED. TODO: remove from |
Justin Donnelly
2014/12/23 14:54:38
Change this to TODO(dschuyler): Remove once refere
dschuyler
2014/12/23 20:00:15
Done.
|
+ // omnibox_metrics_provider.cc and |
+ // autocomplete_match_type.h |
private final int mNativeType; |
@@ -73,8 +75,8 @@ public class OmniboxSuggestion { |
} |
public boolean isHistoryUrl() { |
- return this == HISTORY_URL || this == HISTORY_TITLE || |
- this == HISTORY_BODY || this == HISTORY_KEYWORD; |
+ return this == HISTORY_URL || this == HISTORY_TITLE |
+ || this == HISTORY_BODY || this == HISTORY_KEYWORD; |
} |
public boolean isUrl() { |
@@ -188,8 +190,8 @@ public class OmniboxSuggestion { |
@Override |
public int hashCode() { |
- int hash = 37 * mType.mNativeType + mDisplayText.hashCode() + mFillIntoEdit.hashCode() + |
- (mIsStarred ? 1 : 0) + (mIsDeletable ? 1 : 0); |
+ int hash = 37 * mType.mNativeType + mDisplayText.hashCode() + mFillIntoEdit.hashCode() |
+ + (mIsStarred ? 1 : 0) + (mIsDeletable ? 1 : 0); |
if (mAnswerContents != null) { |
hash = hash + mAnswerContents.hashCode(); |
} |
@@ -205,10 +207,10 @@ public class OmniboxSuggestion { |
OmniboxSuggestion suggestion = (OmniboxSuggestion) obj; |
boolean answersAreEqual = |
- (mAnswerContents == null && suggestion.mAnswerContents == null) || |
- (mAnswerContents != null && |
- suggestion.mAnswerContents != null && |
- mAnswerContents.equals(suggestion.mAnswerContents)); |
+ (mAnswerContents == null && suggestion.mAnswerContents == null) |
+ || (mAnswerContents != null |
+ && suggestion.mAnswerContents != null |
+ && mAnswerContents.equals(suggestion.mAnswerContents)); |
return mType == suggestion.mType |
&& mFillIntoEdit.equals(suggestion.mFillIntoEdit) |
&& mDisplayText.equals(suggestion.mDisplayText) |