Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java

Issue 815273002: Remove and deprecate SEARCH_SUGGEST_ANSWER (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_controller.cc » ('j') | components/metrics/proto/omnibox_event.proto » ('J')

Powered by Google App Engine
This is Rietveld 408576698