• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4//
5// Stores information about an omnibox interaction.
6
7syntax = "proto2";
8
9option optimize_for = LITE_RUNTIME;
10
11package metrics;
12
13import "omnibox_input_type.proto";
14
15// Next tag: 17
16message OmniboxEventProto {
17  // The timestamp for the event, in seconds since the epoch.
18  optional int64 time = 1;
19
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;
25
26  // The number of characters the user had typed before autocompleting.
27  optional int32 typed_length = 3;
28
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;
32
33  // The number of terms that the user typed in the omnibox.
34  optional int32 num_typed_terms = 4;
35
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;
39
40  // Whether or not the top match was hidden in the omnibox suggestions
41  // dropdown.
42  optional bool is_top_result_hidden_in_dropdown = 14;
43
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;
52
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;
56
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;
65
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;
72
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;
81
82  // The type of page currently displayed when the user used the omnibox.
83  enum PageClassification {
84    // An invalid URL; shouldn't happen.
85    INVALID_SPEC = 0;
86
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.
94    NTP = 1;
95
96    // about:blank.
97    BLANK = 2;
98
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.
102    HOME_PAGE = 3;
103
104    // The catch-all entry of everything not included somewhere else
105    // on this list.
106    OTHER = 4;
107
108    // The instant new tab page enum value was deprecated on August 2, 2013.
109    OBSOLETE_INSTANT_NTP = 5;
110
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;
115
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;
119
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;
123
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;
128
129    // When adding new classifications, please consider adding them in
130    // chrome/browser/resources/omnibox/omnibox.html
131    // so that these new options are displayed on about:omnibox.
132  }
133  optional PageClassification current_page_classification = 10;
134
135  optional OmniboxInputType.Type input_type = 8;
136
137  // An enum used in multiple places below.
138  enum ProviderType {
139    UNKNOWN_PROVIDER = 0;  // Unknown provider (should not reach here)
140    HISTORY_URL = 1;       // URLs in history, or user-typed URLs
141    HISTORY_CONTENTS = 2;  // Matches for page contents of pages in history
142    HISTORY_QUICK = 3;     // Matches for recently or frequently visited pages
143                           // in history
144    SEARCH = 4;            // Search suggestions for the default search engine
145    KEYWORD = 5;           // Keyword-triggered searches
146    BUILTIN = 6;           // Built-in URLs, such as chrome://version
147    SHORTCUTS = 7;         // Recently selected omnibox suggestions
148    EXTENSION_APPS = 8;    // Custom suggestions from extensions and/or apps
149    CONTACT = 9;           // DEPRECATED. The user's contacts
150    BOOKMARK = 10;         // The user's bookmarks
151    ZERO_SUGGEST = 11;     // Suggestions based on the current page
152    // This enum value is currently only used by Android GSA. It represents
153    // a suggestion from the phone.
154    ON_DEVICE = 12;
155  }
156
157  // The result set displayed on the completion popup
158  // Next tag: 6
159  message Suggestion {
160    // Where does this result come from?
161    optional ProviderType provider = 1;
162
163    // What kind of result this is.
164    // This corresponds to the AutocompleteMatch::Type enumeration in
165    // chrome/browser/autocomplete/autocomplete_match.h (except for Android
166    // GSA result types).
167    enum ResultType {
168      UNKNOWN_RESULT_TYPE = 0;    // Unknown type (should not reach here)
169      URL_WHAT_YOU_TYPED = 1;     // The input as a URL
170      HISTORY_URL = 2;            // A past page whose URL contains the input
171      HISTORY_TITLE = 3;          // A past page whose title contains the input
172      HISTORY_BODY = 4;           // A past page whose body contains the input
173      HISTORY_KEYWORD = 5;        // A past page whose keyword contains the
174                                  // input
175      NAVSUGGEST = 6;             // A suggested URL
176      SEARCH_WHAT_YOU_TYPED = 7;  // The input as a search query (with the
177                                  // default engine)
178      SEARCH_HISTORY = 8;         // A past search (with the default engine)
179                                  // containing the input
180      SEARCH_SUGGEST = 9;         // A suggested search (with the default
181                                  // engine) for a query.
182      SEARCH_OTHER_ENGINE = 10;   // A search with a non-default engine
183      EXTENSION_APP = 11;         // An Extension App with a title/url that
184                                  // contains the input
185      CONTACT = 12;               // One of the user's contacts
186      BOOKMARK_TITLE = 13;        // A bookmark whose title contains the input.
187      SEARCH_SUGGEST_ENTITY = 14; // A suggested search for an entity.
188      SEARCH_SUGGEST_INFINITE = 15; // A suggested search to complete the tail
189                                    // of the query.
190      SEARCH_SUGGEST_PERSONALIZED = 16; // A personalized suggested search.
191      SEARCH_SUGGEST_PROFILE = 17;  // A personalized suggested search for a
192                                    // Google+ profile.
193      APP_RESULT = 18;              // Result from an installed app
194                                    // (eg: a gmail email).
195                                    // Used by Android GSA for on-device
196                                    // suggestion logging.
197      APP = 19;                     // An app result (eg: the gmail app).
198                                    // Used by Android GSA for on-device
199                                    // suggestion logging.
200      LEGACY_ON_DEVICE = 20;        // An on-device result from a legacy
201                                    // provider. That is, this result is not
202                                    // from the on-device suggestion provider
203                                    // (go/icing). This field is
204                                    // used by Android GSA for on-device
205                                    // suggestion logging.
206      NAVSUGGEST_PERSONALIZED = 21; // A personalized url.
207      SEARCH_SUGGEST_ANSWER   = 22; // A short result for a suggested search.
208    }
209    optional ResultType result_type = 2;
210
211    // The relevance score for this suggestion.
212    optional int32 relevance = 3;
213
214    // How many times this result was typed in / selected from the omnibox.
215    // Only set for some providers and result_types.  At the time of
216    // writing this comment, it is only set for HistoryURL and
217    // HistoryQuickProvider matches.
218    optional int32 typed_count = 5;
219
220    // Whether this item is starred (bookmarked) or not.
221    optional bool is_starred = 4;
222  }
223  repeated Suggestion suggestion = 9;
224
225  // A data structure that holds per-provider information, general information
226  // not associated with a particular result.
227  // Next tag: 6
228  message ProviderInfo {
229    // Which provider generated this ProviderInfo entry.
230    optional ProviderType provider = 1;
231
232    // The provider's done() value, i.e., whether it's completed processing
233    // the query.  Providers which don't do any asynchronous processing
234    // will always be done.
235    optional bool provider_done = 2;
236
237    // The set of field trials that have triggered in the most recent query,
238    // possibly affecting the shown suggestions.  Each element is a hash
239    // of the corresponding field trial name.
240    // See chrome/browser/autocomplete/search_provider.cc for a specific usage
241    // example.
242    repeated fixed32 field_trial_triggered = 3;
243
244    // Same as above except that the set of field trials is a union of all field
245    // trials that have triggered within the current omnibox session including
246    // the most recent query.
247    // See AutocompleteController::ResetSession() for more details on the
248    // definition of a session.
249    // See chrome/browser/autocomplete/search_provider.cc for a specific usage
250    // example.
251    repeated fixed32 field_trial_triggered_in_session = 4;
252
253    // The number of times this provider returned a non-zero number of
254    // suggestions during this omnibox session.
255    // Note that each provider may define a session differently for its
256    // purposes.
257    optional int32 times_returned_results_in_session = 5;
258  }
259  // A list of diagnostic information about each provider.  Providers
260  // will appear at most once in this list.
261  repeated ProviderInfo provider_info = 12;
262}
263