1 // Copyright 2014 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;
13 import "omnibox_input_type.proto";
16 message OmniboxEventProto {
17 // The timestamp for the event, in seconds since the epoch.
18 optional int64 time = 1;
20 // The id of the originating tab for this omnibox interaction.
21 // This is the current tab *unless* the user opened the target in a new tab.
22 // In those cases, this is unset. Tab ids are unique for a given session_id
23 // (in the containing protocol buffer ChromeUserMetricsExtensionProto).
24 optional int32 tab_id = 2;
26 // The number of characters the user had typed before autocompleting.
27 optional int32 typed_length = 3;
29 // Whether the user deleted text immediately before selecting an omnibox
30 // suggestion. This is usually the result of pressing backspace or delete.
31 optional bool just_deleted_text = 11;
33 // The number of terms that the user typed in the omnibox.
34 optional int32 num_typed_terms = 4;
36 // The index of the item that the user selected in the omnibox popup list.
37 // This corresponds the index of the |suggestion| below.
38 optional int32 selected_index = 5;
40 // Whether or not the top match was hidden in the omnibox suggestions
42 optional bool is_top_result_hidden_in_dropdown = 14;
44 // Whether the omnibox popup is open. It can be closed if, for instance,
45 // the user clicks in the omnibox and hits return to reload the same page.
46 // If the popup is closed, the suggestion list will contain only one item
47 // and selected_index will be 0 (pointing to that single item). Because
48 // paste-and-search/paste-and-go actions ignore the current content of the
49 // omnibox dropdown (if it is open) when they happen, we pretend the
50 // dropdown is closed when logging these.
51 optional bool is_popup_open = 15;
53 // True if this is a paste-and-search or paste-and-go action. (The codebase
54 // refers to both these types as paste-and-go.)
55 optional bool is_paste_and_go = 16;
57 // The length of the inline autocomplete text in the omnibox.
58 // The sum |typed_length| + |completed_length| gives the full length of the
59 // user-visible text in the omnibox.
60 // This field is only set for suggestions that are allowed to be the default
61 // match and omitted otherwise. The first suggestion is always allowed to
62 // be the default match. (This is an enforced constraint.) Hence, if
63 // |selected_index| == 0, then this field will always be set.
64 optional int32 completed_length = 6;
66 // The amount of time, in milliseconds, since the user first began modifying
67 // the text in the omnibox. If at some point after modifying the text, the
68 // user reverts the modifications (thus seeing the current web page's URL
69 // again), then writes in the omnibox again, this elapsed time should start
70 // from the time of the second series of modification.
71 optional int64 typing_duration_ms = 7;
73 // The amount of time, in milliseconds, since the last time the default
74 // (inline) match changed. This may be longer than the time since the
75 // last keystroke. (The last keystroke may not have changed the default
76 // match.) It may also be shorter than the time since the last keystroke
77 // because the default match might have come from an asynchronous
78 // provider. Regardless, it should always be less than or equal to
79 // the field |typing_duration_ms|.
80 optional int64 duration_since_last_default_match_update_ms = 13;
82 // The type of page currently displayed when the user used the omnibox.
83 enum PageClassification {
84 // An invalid URL; shouldn't happen.
87 // chrome://newtab/. This can be either the built-in version or a
88 // replacement new tab page from an extension. Note that when Instant
89 // Extended is enabled, the new tab page will be reported as either
90 // INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS or
91 // INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS below,
92 // unless an extension is replacing the new tab page, in which case
93 // it will still be reported as NTP.
99 // The user's home page. Note that if the home page is set to any
100 // of the new tab page versions or to about:blank, then we'll
101 // classify the page into those categories, not HOME_PAGE.
104 // The catch-all entry of everything not included somewhere else
108 // The instant new tab page enum value was deprecated on August 2, 2013.
109 OBSOLETE_INSTANT_NTP = 5;
111 // The user is on a search result page that's doing search term
112 // replacement, meaning the search terms should've appeared in the omnibox
113 // before the user started editing it, not the URL of the page.
114 SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT = 6;
116 // The new tab page in which this omnibox interaction first started
117 // with the user having focus in the omnibox.
118 INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS = 7;
120 // The new tab page in which this omnibox interaction first started
121 // with the user having focus in the fakebox.
122 INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS = 8;
124 // The user is on a search result page that's not doing search term
125 // replacement, meaning the URL of the page should've appeared in the
126 // omnibox before the user started editing it, not the search terms.
127 SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT = 9;
129 // The user is on the home screen.
132 // The user is in the search app.
135 // The user is in the maps app.
138 // When adding new classifications, please consider adding them in
139 // chrome/browser/resources/omnibox/omnibox.html
140 // so that these new options are displayed on about:omnibox.
142 optional PageClassification current_page_classification = 10;
144 optional OmniboxInputType.Type input_type = 8;
146 // An enum used in multiple places below.
148 UNKNOWN_PROVIDER = 0; // Unknown provider (should not reach here)
149 HISTORY_URL = 1; // URLs in history, or user-typed URLs
150 HISTORY_CONTENTS = 2; // Matches for page contents of pages in history
151 HISTORY_QUICK = 3; // Matches for recently or frequently visited pages
153 SEARCH = 4; // Search suggestions for the default search engine
154 KEYWORD = 5; // Keyword-triggered searches
155 BUILTIN = 6; // Built-in URLs, such as chrome://version
156 SHORTCUTS = 7; // Recently selected omnibox suggestions
157 EXTENSION_APPS = 8; // DEPRECATED. Suggestions from extensions or apps
158 CONTACT = 9; // DEPRECATED. The user's contacts
159 BOOKMARK = 10; // The user's bookmarks
160 ZERO_SUGGEST = 11; // Suggestions based on the current page
161 // This enum value is currently only used by Android GSA. It represents
162 // a suggestion from the phone.
164 // This enum value is currently only used by Android GSA. It represents
165 // a suggestion powered by a Chrome content provider.
166 ON_DEVICE_CHROME = 13;
169 // The result set displayed on the completion popup
172 // Where does this result come from?
173 optional ProviderType provider = 1;
175 // What kind of result this is.
176 // This corresponds to the AutocompleteMatch::Type enumeration in
177 // components/omnibox/autocomplete_match.h (except for Android
178 // GSA result types).
180 UNKNOWN_RESULT_TYPE = 0; // Unknown type (should not reach here)
181 URL_WHAT_YOU_TYPED = 1; // The input as a URL
182 HISTORY_URL = 2; // A past page whose URL contains the input
183 HISTORY_TITLE = 3; // A past page whose title contains the input
184 HISTORY_BODY = 4; // DEPRECATED. A past page whose body
185 // contains the input
186 HISTORY_KEYWORD = 5; // A past page whose keyword contains the
188 NAVSUGGEST = 6; // A suggested URL
189 SEARCH_WHAT_YOU_TYPED = 7; // The input as a search query (with the
191 SEARCH_HISTORY = 8; // A past search (with the default engine)
192 // containing the input
193 SEARCH_SUGGEST = 9; // A suggested search (with the default
194 // engine) for a query.
195 SEARCH_OTHER_ENGINE = 10; // A search with a non-default engine
196 EXTENSION_APP = 11; // DEPRECATED. An Extension App with a
197 // title/url that contains the input.
198 CONTACT = 12; // One of the user's contacts
199 BOOKMARK_TITLE = 13; // A bookmark whose title contains the input.
200 SEARCH_SUGGEST_ENTITY = 14; // A suggested search for an entity.
201 SEARCH_SUGGEST_INFINITE = 15; // A suggested search to complete the tail
203 SEARCH_SUGGEST_PERSONALIZED = 16; // A personalized suggested search.
204 SEARCH_SUGGEST_PROFILE = 17; // A personalized suggested search for a
206 APP_RESULT = 18; // Result from an installed app
207 // (eg: a gmail email).
208 // Used by Android GSA for on-device
209 // suggestion logging.
210 APP = 19; // An app result (eg: the gmail app).
211 // Used by Android GSA for on-device
212 // suggestion logging.
213 LEGACY_ON_DEVICE = 20; // An on-device result from a legacy
214 // provider. That is, this result is not
215 // from the on-device suggestion provider
216 // (go/icing). This field is
217 // used by Android GSA for on-device
218 // suggestion logging.
219 NAVSUGGEST_PERSONALIZED = 21; // A personalized url.
220 SEARCH_SUGGEST_ANSWER = 22; // A short result for a suggested search.
222 optional ResultType result_type = 2;
224 // The relevance score for this suggestion.
225 optional int32 relevance = 3;
227 // How many times this result was typed in / selected from the omnibox.
228 // Only set for some providers and result_types. At the time of
229 // writing this comment, it is only set for HistoryURL and
230 // HistoryQuickProvider matches.
231 optional int32 typed_count = 5;
233 // Whether this item is starred (bookmarked) or not.
234 optional bool is_starred = 4 [deprecated=true];
236 // Whether this item is disabled in the UI (not clickable).
237 optional bool is_disabled = 6;
239 repeated Suggestion suggestion = 9;
241 // A data structure that holds per-provider information, general information
242 // not associated with a particular result.
244 message ProviderInfo {
245 // Which provider generated this ProviderInfo entry.
246 optional ProviderType provider = 1;
248 // The provider's done() value, i.e., whether it's completed processing
249 // the query. Providers which don't do any asynchronous processing
250 // will always be done.
251 optional bool provider_done = 2;
253 // The set of field trials that have triggered in the most recent query,
254 // possibly affecting the shown suggestions. Each element is a hash
255 // of the corresponding field trial name.
256 // See chrome/browser/autocomplete/search_provider.cc for a specific usage
258 repeated fixed32 field_trial_triggered = 3;
260 // Same as above except that the set of field trials is a union of all field
261 // trials that have triggered within the current omnibox session including
262 // the most recent query.
263 // See AutocompleteController::ResetSession() for more details on the
264 // definition of a session.
265 // See chrome/browser/autocomplete/search_provider.cc for a specific usage
267 repeated fixed32 field_trial_triggered_in_session = 4;
269 // The number of times this provider returned a non-zero number of
270 // suggestions during this omnibox session.
271 // Note that each provider may define a session differently for its
273 optional int32 times_returned_results_in_session = 5;
275 // A list of diagnostic information about each provider. Providers
276 // will appear at most once in this list.
277 repeated ProviderInfo provider_info = 12;