Commit cf6256f2 authored by mpearson@chromium.org's avatar mpearson@chromium.org

Omnibox: In UMA logs, record typed_count of URLS.

For UMA opted-in users, record the typed_counts of users that show up as omnibox suggestions.

This has been approved by the privacy folks.

BUG=
TEST=using VLOG in the appropriate place in metrics_base.cc


Review URL: https://chromiumcodereview.appspot.com/10544114

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141787 0039d316-1c4b-4281-b951-d872f2087c98
parent 4e0cb1b6
...@@ -26,6 +26,7 @@ const char16 AutocompleteMatch::kInvalidChars[] = { ...@@ -26,6 +26,7 @@ const char16 AutocompleteMatch::kInvalidChars[] = {
AutocompleteMatch::AutocompleteMatch() AutocompleteMatch::AutocompleteMatch()
: provider(NULL), : provider(NULL),
relevance(0), relevance(0),
typed_count(-1),
deletable(false), deletable(false),
inline_autocomplete_offset(string16::npos), inline_autocomplete_offset(string16::npos),
transition(content::PAGE_TRANSITION_GENERATED), transition(content::PAGE_TRANSITION_GENERATED),
...@@ -41,6 +42,7 @@ AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, ...@@ -41,6 +42,7 @@ AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider,
Type type) Type type)
: provider(provider), : provider(provider),
relevance(relevance), relevance(relevance),
typed_count(-1),
deletable(deletable), deletable(deletable),
inline_autocomplete_offset(string16::npos), inline_autocomplete_offset(string16::npos),
transition(content::PAGE_TRANSITION_TYPED), transition(content::PAGE_TRANSITION_TYPED),
...@@ -53,6 +55,7 @@ AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, ...@@ -53,6 +55,7 @@ AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider,
AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match) AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match)
: provider(match.provider), : provider(match.provider),
relevance(match.relevance), relevance(match.relevance),
typed_count(match.typed_count),
deletable(match.deletable), deletable(match.deletable),
fill_into_edit(match.fill_into_edit), fill_into_edit(match.fill_into_edit),
inline_autocomplete_offset(match.inline_autocomplete_offset), inline_autocomplete_offset(match.inline_autocomplete_offset),
...@@ -82,6 +85,7 @@ AutocompleteMatch& AutocompleteMatch::operator=( ...@@ -82,6 +85,7 @@ AutocompleteMatch& AutocompleteMatch::operator=(
provider = match.provider; provider = match.provider;
relevance = match.relevance; relevance = match.relevance;
typed_count = match.typed_count;
deletable = match.deletable; deletable = match.deletable;
fill_into_edit = match.fill_into_edit; fill_into_edit = match.fill_into_edit;
inline_autocomplete_offset = match.inline_autocomplete_offset; inline_autocomplete_offset = match.inline_autocomplete_offset;
......
...@@ -203,6 +203,12 @@ struct AutocompleteMatch { ...@@ -203,6 +203,12 @@ struct AutocompleteMatch {
// rather than being a fairly fixed value defined by the table above. // rather than being a fairly fixed value defined by the table above.
int relevance; int relevance;
// How many times this result was typed in / selected from the omnibox.
// Only set for some providers and result_types. If it is not set,
// its value is -1. At the time of writing this comment, it is only
// set for matches from HistoryURL and HistoryQuickProvider.
int typed_count;
// True if the user should be able to delete this match. // True if the user should be able to delete this match.
bool deletable; bool deletable;
......
...@@ -193,6 +193,7 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch( ...@@ -193,6 +193,7 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch(
AutocompleteMatch match(this, score, !!info.visit_count(), AutocompleteMatch match(this, score, !!info.visit_count(),
history_match.url_matches.empty() ? history_match.url_matches.empty() ?
AutocompleteMatch::HISTORY_TITLE : AutocompleteMatch::HISTORY_URL); AutocompleteMatch::HISTORY_TITLE : AutocompleteMatch::HISTORY_URL);
match.typed_count = info.typed_count();
match.destination_url = info.url(); match.destination_url = info.url();
DCHECK(match.destination_url.is_valid()); DCHECK(match.destination_url.is_valid());
......
...@@ -893,6 +893,7 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( ...@@ -893,6 +893,7 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
const history::URLRow& info = history_match.url_info; const history::URLRow& info = history_match.url_info;
AutocompleteMatch match(this, relevance, AutocompleteMatch match(this, relevance,
!!info.visit_count(), AutocompleteMatch::HISTORY_URL); !!info.visit_count(), AutocompleteMatch::HISTORY_URL);
match.typed_count = info.typed_count();
match.destination_url = info.url(); match.destination_url = info.url();
DCHECK(match.destination_url.is_valid()); DCHECK(match.destination_url.is_valid());
size_t inline_autocomplete_offset = size_t inline_autocomplete_offset =
......
...@@ -943,6 +943,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) { ...@@ -943,6 +943,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
suggestion->set_provider(i->provider->AsOmniboxEventProviderType()); suggestion->set_provider(i->provider->AsOmniboxEventProviderType());
suggestion->set_result_type(AsOmniboxEventResultType(i->type)); suggestion->set_result_type(AsOmniboxEventResultType(i->type));
suggestion->set_relevance(i->relevance); suggestion->set_relevance(i->relevance);
if (i->typed_count != -1)
suggestion->set_typed_count(i->typed_count);
suggestion->set_is_starred(i->starred); suggestion->set_is_starred(i->starred);
} }
for (ProvidersInfo::const_iterator i(log.providers_info.begin()); for (ProvidersInfo::const_iterator i(log.providers_info.begin());
......
...@@ -88,6 +88,7 @@ message OmniboxEventProto { ...@@ -88,6 +88,7 @@ message OmniboxEventProto {
} }
// The result set displayed on the completion popup // The result set displayed on the completion popup
// Next tag: 6
message Suggestion { message Suggestion {
// Where does this result come from? // Where does this result come from?
optional ProviderType provider = 1; optional ProviderType provider = 1;
...@@ -119,6 +120,12 @@ message OmniboxEventProto { ...@@ -119,6 +120,12 @@ message OmniboxEventProto {
// The relevance score for this suggestion. // The relevance score for this suggestion.
optional int32 relevance = 3; optional int32 relevance = 3;
// How many times this result was typed in / selected from the omnibox.
// Only set for some providers and result_types. At the time of
// writing this comment, it is only set for HistoryURL and
// HistoryQuickProvider matches.
optional int32 typed_count = 5;
// Whether this item is starred (bookmarked) or not. // Whether this item is starred (bookmarked) or not.
optional bool is_starred = 4; optional bool is_starred = 4;
} }
......
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