1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Stores information about an omnibox interaction.
9 option optimize_for = LITE_RUNTIME;
14 message OmniboxEventProto {
15 // The timestamp for the event, in seconds since the epoch.
16 optional int64 time = 1;
18 // The id of the originating tab for this omnibox interaction.
19 // This is the current tab *unless* the user opened the target in a new tab.
20 // In those cases, this is unset. Tab ids are unique for a given session_id
21 // (in the containing protocol buffer ChromeUserMetricsExtensionsProto).
22 optional int32 tab_id = 2;
24 // The number of characters the user had typed before autocompleting.
25 optional int32 typed_length = 3;
27 // Whether the user deleted text immediately before selecting an omnibox
28 // suggestion. This is usually the result of pressing backspace or delete.
29 optional bool just_deleted_text = 11;
31 // The number of terms that the user typed in the omnibox.
32 optional int32 num_typed_terms = 4;
34 // The index of the item that the user selected in the omnibox popup list.
35 // This corresponds the index of the |suggestion| below.
36 optional int32 selected_index = 5;
38 // Whether or not the top match was hidden in the omnibox suggestions
40 optional bool is_top_result_hidden_in_dropdown = 14;
42 // The length of the inline autocomplete text in the omnibox.
43 // The sum |typed_length| + |completed_length| gives the full length of the
44 // user-visible text in the omnibox.
45 // This field is only set for inlineable suggestions selected at position 0
46 // (|selected_index| = 0) and will be omitted otherwise.
47 optional int32 completed_length = 6;
49 // The amount of time, in milliseconds, since the user first began modifying
50 // the text in the omnibox. If at some point after modifying the text, the
51 // user reverts the modifications (thus seeing the current web page's URL
52 // again), then writes in the omnibox again, this elapsed time should start
53 // from the time of the second series of modification.
54 optional int64 typing_duration_ms = 7;
56 // The amount of time, in milliseconds, since the last time the default
57 // (inline) match changed. This may be longer than the time since the
58 // last keystroke. (The last keystroke may not have changed the default
59 // match.) It may also be shorter than the time since the last keystroke
60 // because the default match might have come from an asynchronous
61 // provider. Regardless, it should always be less than or equal to
62 // the field |typing_duration_ms|.
63 optional int64 duration_since_last_default_match_update_ms = 13;
65 // The type of page currently displayed when the user used the omnibox.
66 enum PageClassification {
67 // An invalid URL; shouldn't happen.
70 // chrome://newtab/. This can be either the built-in version or a
71 // replacement new tab page from an extension. Note that when Instant
72 // Extended is enabled, the new tab page will be reported as either
73 // INSTANT_NEW_TAB_PAGE_WITH_OMNIBOX_AS_STARTING_FOCUS or
74 // INSTANT_NEW_TAB_PAGE_WITH_FAKEBOX_AS_STARTING_FOCUS below,
75 // unless an extension is replacing the new tab page, in which case
76 // it will still be reported as NEW_TAB_PAGE.
82 // The user's home page. Note that if the home page is set to any
83 // of the new tab page versions or to about:blank, then we'll
84 // classify the page into those categories, not HOME_PAGE.
87 // The catch-all entry of everything not included somewhere else
91 // The instant new tab page enum value was deprecated on August 2, 2013.
92 OBSOLETE_INSTANT_NEW_TAB_PAGE = 5;
94 // The user is on a search result page that's doing search term
95 // replacement, meaning the search terms should've appeared in the omnibox
96 // before the user started editing it, not the URL of the page.
97 SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT = 6;
99 // The new tab page in which this omnibox interaction first started
100 // with the user having focus in the omnibox.
101 INSTANT_NEW_TAB_PAGE_WITH_OMNIBOX_AS_STARTING_FOCUS = 7;
103 // The new tab page in which this omnibox interaction first started
104 // with the user having focus in the fakebox.
105 INSTANT_NEW_TAB_PAGE_WITH_FAKEBOX_AS_STARTING_FOCUS = 8;
107 // The user is on a search result page that's not doing search term
108 // replacement, meaning the URL of the page should've appeared in the
109 // omnibox before the user started editing it, not the search terms.
110 SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT = 9;
112 optional PageClassification current_page_classification = 10;
114 // What kind of input the user provided.
116 INVALID = 0; // Empty input (should not reach here)
117 UNKNOWN = 1; // Valid input whose type cannot be determined
118 REQUESTED_URL = 2; // DEPRECATED. Input autodetected as UNKNOWN, which the
119 // user wants to treat as an URL by specifying a
121 URL = 3; // Input autodetected as a URL
122 QUERY = 4; // Input autodetected as a query
123 FORCED_QUERY = 5; // Input forced to be a query by an initial '?'
125 optional InputType input_type = 8;
127 // An enum used in multiple places below.
129 UNKNOWN_PROVIDER = 0; // Unknown provider (should not reach here)
130 HISTORY_URL = 1; // URLs in history, or user-typed URLs
131 HISTORY_CONTENTS = 2; // Matches for page contents of pages in history
132 HISTORY_QUICK = 3; // Matches for recently or frequently visited pages
134 SEARCH = 4; // Search suggestions for the default search engine
135 KEYWORD = 5; // Keyword-triggered searches
136 BUILTIN = 6; // Built-in URLs, such as chrome://version
137 SHORTCUTS = 7; // Recently selected omnibox suggestions
138 EXTENSION_APPS = 8; // Custom suggestions from extensions and/or apps
139 CONTACT = 9; // The user's contacts
140 BOOKMARK = 10; // The user's bookmarks
141 ZERO_SUGGEST = 11; // Suggestions based on the current page
144 // The result set displayed on the completion popup
147 // Where does this result come from?
148 optional ProviderType provider = 1;
150 // What kind of result this is.
151 // This corresponds to the AutocompleteMatch::Type enumeration in
152 // chrome/browser/autocomplete/autocomplete_match.h
154 UNKNOWN_RESULT_TYPE = 0; // Unknown type (should not reach here)
155 URL_WHAT_YOU_TYPED = 1; // The input as a URL
156 HISTORY_URL = 2; // A past page whose URL contains the input
157 HISTORY_TITLE = 3; // A past page whose title contains the input
158 HISTORY_BODY = 4; // A past page whose body contains the input
159 HISTORY_KEYWORD = 5; // A past page whose keyword contains the
161 NAVSUGGEST = 6; // A suggested URL
162 SEARCH_WHAT_YOU_TYPED = 7; // The input as a search query (with the
164 SEARCH_HISTORY = 8; // A past search (with the default engine)
165 // containing the input
166 SEARCH_SUGGEST = 9; // A suggested search (with the default
168 SEARCH_OTHER_ENGINE = 10; // A search with a non-default engine
169 EXTENSION_APP = 11; // An Extension App with a title/url that
170 // contains the input
171 CONTACT = 12; // One of the user's contacts
172 BOOKMARK_TITLE = 13; // A bookmark whose title contains the input.
174 optional ResultType result_type = 2;
176 // The relevance score for this suggestion.
177 optional int32 relevance = 3;
179 // How many times this result was typed in / selected from the omnibox.
180 // Only set for some providers and result_types. At the time of
181 // writing this comment, it is only set for HistoryURL and
182 // HistoryQuickProvider matches.
183 optional int32 typed_count = 5;
185 // Whether this item is starred (bookmarked) or not.
186 optional bool is_starred = 4;
188 repeated Suggestion suggestion = 9;
190 // A data structure that holds per-provider information, general information
191 // not associated with a particular result.
193 message ProviderInfo {
194 // Which provider generated this ProviderInfo entry.
195 optional ProviderType provider = 1;
197 // The provider's done() value, i.e., whether it's completed processing
198 // the query. Providers which don't do any asynchronous processing
199 // will always be done.
200 optional bool provider_done = 2;
202 // The set of field trials that have triggered in the most recent query,
203 // possibly affecting the shown suggestions. Each element is a hash
204 // of the corresponding field trial name.
205 // See chrome/browser/autocomplete/search_provider.cc for a specific usage
207 repeated fixed32 field_trial_triggered = 3;
209 // Same as above except that the set of field trials is a union of all field
210 // trials that have triggered within the current omnibox session including
211 // the most recent query.
212 // See AutocompleteController::ResetSession() for more details on the
213 // definition of a session.
214 // See chrome/browser/autocomplete/search_provider.cc for a specific usage
216 repeated fixed32 field_trial_triggered_in_session = 4;
218 // A list of diagnostic information about each provider. Providers
219 // will appear at most once in this list.
220 repeated ProviderInfo provider_info = 12;