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

Unified Diff: chrome/browser/autocomplete/keyword_provider.cc

Issue 320713002: Revert of Omnibox: Combine Two Input Type Enums into One (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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
« no previous file with comments | « chrome/browser/autocomplete/keyword_provider.h ('k') | chrome/browser/autocomplete/search_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/keyword_provider.cc
diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc
index 44e93544273e8401f0dde43bd927849f8f2e1622..5740e90c4e715ca9c7dfa2ffcdb02f03fd06cff6 100644
--- a/chrome/browser/autocomplete/keyword_provider.cc
+++ b/chrome/browser/autocomplete/keyword_provider.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
-#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "extensions/browser/extension_system.h"
@@ -341,8 +340,8 @@
bool KeywordProvider::ExtractKeywordFromInput(const AutocompleteInput& input,
base::string16* keyword,
base::string16* remaining_input) {
- if ((input.type() == metrics::OmniboxInputType::INVALID) ||
- (input.type() == metrics::OmniboxInputType::FORCED_QUERY))
+ if ((input.type() == AutocompleteInput::INVALID) ||
+ (input.type() == AutocompleteInput::FORCED_QUERY))
return false;
*keyword = TemplateURLService::CleanUserInputKeyword(
@@ -351,7 +350,7 @@
}
// static
-int KeywordProvider::CalculateRelevance(metrics::OmniboxInputType::Type type,
+int KeywordProvider::CalculateRelevance(AutocompleteInput::Type type,
bool complete,
bool supports_replacement,
bool prefer_keyword,
@@ -366,11 +365,10 @@
// make such a change, however, you should update this comment to
// describe it, so it's clear why the functions diverge.
if (!complete)
- return (type == metrics::OmniboxInputType::URL) ? 700 : 450;
+ return (type == AutocompleteInput::URL) ? 700 : 450;
if (!supports_replacement || (allow_exact_keyword_match && prefer_keyword))
return 1500;
- return (allow_exact_keyword_match &&
- (type == metrics::OmniboxInputType::QUERY)) ?
+ return (allow_exact_keyword_match && (type == AutocompleteInput::QUERY)) ?
1450 : 1100;
}
« no previous file with comments | « chrome/browser/autocomplete/keyword_provider.h ('k') | chrome/browser/autocomplete/search_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698