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

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

Issue 319523005: Omnibox: Combine Two Input Type Enums into One (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again 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
Index: chrome/browser/autocomplete/extension_app_provider.cc
diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc
index 8eea0afce045b4ec010ea91b6d7b62b9adb40d42..479c15af29363db0a5bfeb0286ab0687b62ed0cb 100644
--- a/chrome/browser/autocomplete/extension_app_provider.cc
+++ b/chrome/browser/autocomplete/extension_app_provider.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
+#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "content/public/browser/notification_source.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
@@ -106,8 +107,8 @@ void ExtensionAppProvider::Start(const AutocompleteInput& input,
bool minimal_changes) {
matches_.clear();
- if ((input.type() == AutocompleteInput::INVALID) ||
- (input.type() == AutocompleteInput::FORCED_QUERY))
+ if ((input.type() == metrics::OmniboxInputType::INVALID) ||
+ (input.type() == metrics::OmniboxInputType::FORCED_QUERY))
return;
if (input.text().empty())
@@ -133,8 +134,8 @@ void ExtensionAppProvider::Start(const AutocompleteInput& input,
std::search(url.begin(), url.end(),
input.text().begin(), input.text().end(),
base::CaseInsensitiveCompare<base::char16>());
- matches_url = url_iter != url.end() &&
- input.type() != AutocompleteInput::FORCED_QUERY;
+ matches_url = (url_iter != url.end()) &&
+ (input.type() != metrics::OmniboxInputType::FORCED_QUERY);
url_match_index = matches_url ?
static_cast<size_t>(url_iter - url.begin()) : base::string16::npos;
}
@@ -191,10 +192,11 @@ void ExtensionAppProvider::Observe(int type,
RefreshAppList();
}
-int ExtensionAppProvider::CalculateRelevance(AutocompleteInput::Type type,
- int input_length,
- int target_length,
- const GURL& url) {
+int ExtensionAppProvider::CalculateRelevance(
+ metrics::OmniboxInputType::Type type,
+ int input_length,
+ int target_length,
+ const GURL& url) {
// If you update the algorithm here, please remember to update the tables in
// autocomplete.h also.
const int kMaxRelevance = 1425;
« no previous file with comments | « chrome/browser/autocomplete/extension_app_provider.h ('k') | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698