Commit d025fe59 authored by Min Qin's avatar Min Qin Committed by Commit Bot

Record omnibox metrics on query tile selection

This CL calls RecordMetrics() on query tile selection, so that
Chrome will send the OmniboxEventProto to the backend.

BUG=1112961

Change-Id: Ia7d220c129c7f1624eb3462e467cbd0e98f4f60a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336309
Commit-Queue: Min Qin <qinmin@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTomasz Wiszkowski <ender@google.com>
Cr-Commit-Position: refs/heads/master@{#795691}
parent 1fb711f6
......@@ -1183,21 +1183,22 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener, StartStopWi
@SuppressWarnings("VisibleForTests")
private void launchSearchUrlForQueryTileSuggestion(QueryTile queryTile) {
int position = -1;
int hashCode = 0;
int suggestionCount = getSuggestionCount();
OmniboxSuggestion suggestion = null;
// Find the suggestion position and hashCode.
for (int i = 0; i < suggestionCount; ++i) {
OmniboxSuggestion suggestion = getSuggestionAt(i);
suggestion = getSuggestionAt(i);
if (suggestion.getType() == OmniboxSuggestionType.TILE_SUGGESTION) {
position = i;
hashCode = suggestion.hashCode();
break;
}
}
if (suggestion == null) return;
GURL updatedUrl = mAutocomplete.updateMatchDestinationUrlWithQueryFormulationTime(position,
hashCode, getElapsedTimeSinceInputChange(), queryTile.queryText,
suggestion.hashCode(), getElapsedTimeSinceInputChange(), queryTile.queryText,
queryTile.searchParams);
mDelegate.loadUrl(updatedUrl.getSpec(), PageTransition.LINK, mLastActionUpTimestamp);
mDelegate.setKeyboardVisibility(false);
recordMetrics(position, WindowOpenDisposition.CURRENT_TAB, suggestion);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment