Add a new entry to omnibox_event.proto to log specific types for the suggestions provided by omnibox. Moreover, in this CL, we implement the mechanics of populating this new entry with specific types of contextual zero-suggest suggestions.
BUG=682420
Review-Url: https://codereview.chromium.org/2755503002
Cr-Commit-Position: refs/heads/master@{#461327}
diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc
index 3ab642a..8ca495a 100644
--- a/components/omnibox/browser/zero_suggest_provider.cc
+++ b/components/omnibox/browser/zero_suggest_provider.cc
@@ -363,6 +363,7 @@
AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0,
match.description.length(), ACMatchClassification::NONE,
&match.description_class);
+ match.subtype_identifier = navigation.subtype_identifier();
return match;
}
@@ -447,7 +448,7 @@
const history::MostVisitedURL& url = most_visited_urls_[i];
SearchSuggestionParser::NavigationResult nav(
client()->GetSchemeClassifier(), url.url,
- AutocompleteMatchType::NAVSUGGEST, url.title, std::string(), false,
+ AutocompleteMatchType::NAVSUGGEST, 0, url.title, std::string(), false,
relevance, true, current_query_string16);
matches_.push_back(NavigationToMatch(nav));
--relevance;
@@ -468,8 +469,10 @@
const SearchSuggestionParser::NavigationResults& nav_results(
results_.navigation_results);
for (SearchSuggestionParser::NavigationResults::const_iterator it(
- nav_results.begin()); it != nav_results.end(); ++it)
+ nav_results.begin());
+ it != nav_results.end(); ++it) {
matches_.push_back(NavigationToMatch(*it));
+ }
}
AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() {