Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / components / metrics / proto / omnibox_event.proto
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
7 syntax = "proto2";
8
9 option optimize_for = LITE_RUNTIME;
10
11 package metrics;
12
13 // Next tag: 17
14 message OmniboxEventProto {
15   // The timestamp for the event, in seconds since the epoch.
16   optional int64 time = 1;
17
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 ChromeUserMetricsExtensionProto).
22   optional int32 tab_id = 2;
23
24   // The number of characters the user had typed before autocompleting.
25   optional int32 typed_length = 3;
26
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;
30
31   // The number of terms that the user typed in the omnibox.
32   optional int32 num_typed_terms = 4;
33
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;
37
38   // Whether or not the top match was hidden in the omnibox suggestions
39   // dropdown.
40   optional bool is_top_result_hidden_in_dropdown = 14;
41
42   // Whether the omnibox popup is open.  It can be closed if, for instance,
43   // the user clicks in the omnibox and hits return to reload the same page.
44   // If the popup is closed, the suggestion list will contain only one item
45   // and selected_index will be 0 (pointing to that single item).  Because
46   // paste-and-search/paste-and-go actions ignore the current content of the
47   // omnibox dropdown (if it is open) when they happen, we pretend the
48   // dropdown is closed when logging these.
49   optional bool is_popup_open = 15;
50
51   // True if this is a paste-and-search or paste-and-go action.  (The codebase
52   // refers to both these types as paste-and-go.)
53   optional bool is_paste_and_go = 16;
54
55   // The length of the inline autocomplete text in the omnibox.
56   // The sum |typed_length| + |completed_length| gives the full length of the
57   // user-visible text in the omnibox.
58   // This field is only set for inlineable suggestions selected at position 0
59   // (|selected_index| = 0) and will be omitted otherwise.
60   optional int32 completed_length = 6;
61
62   // The amount of time, in milliseconds, since the user first began modifying
63   // the text in the omnibox.  If at some point after modifying the text, the
64   // user reverts the modifications (thus seeing the current web page's URL
65   // again), then writes in the omnibox again, this elapsed time should start
66   // from the time of the second series of modification.
67   optional int64 typing_duration_ms = 7;
68
69   // The amount of time, in milliseconds, since the last time the default
70   // (inline) match changed.  This may be longer than the time since the
71   // last keystroke.  (The last keystroke may not have changed the default
72   // match.)  It may also be shorter than the time since the last keystroke
73   // because the default match might have come from an asynchronous
74   // provider.  Regardless, it should always be less than or equal to
75   // the field |typing_duration_ms|.
76   optional int64 duration_since_last_default_match_update_ms = 13;
77
78   // The type of page currently displayed when the user used the omnibox.
79   enum PageClassification {
80     // An invalid URL; shouldn't happen.
81     INVALID_SPEC = 0;
82
83     // chrome://newtab/.  This can be either the built-in version or a
84     // replacement new tab page from an extension.  Note that when Instant
85     // Extended is enabled, the new tab page will be reported as either
86     // INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS or
87     // INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS below,
88     // unless an extension is replacing the new tab page, in which case
89     // it will still be reported as NTP.
90     NTP = 1;
91
92     // about:blank.
93     BLANK = 2;
94
95     // The user's home page.  Note that if the home page is set to any
96     // of the new tab page versions or to about:blank, then we'll
97     // classify the page into those categories, not HOME_PAGE.
98     HOME_PAGE = 3;
99
100     // The catch-all entry of everything not included somewhere else
101     // on this list.
102     OTHER = 4;
103
104     // The instant new tab page enum value was deprecated on August 2, 2013.
105     OBSOLETE_INSTANT_NTP = 5;
106
107     // The user is on a search result page that's doing search term
108     // replacement, meaning the search terms should've appeared in the omnibox
109     // before the user started editing it, not the URL of the page.
110     SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT = 6;
111
112     // The new tab page in which this omnibox interaction first started
113     // with the user having focus in the omnibox.
114     INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS = 7;
115
116     // The new tab page in which this omnibox interaction first started
117     // with the user having focus in the fakebox.
118     INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS = 8;
119
120     // The user is on a search result page that's not doing search term
121     // replacement, meaning the URL of the page should've appeared in the
122     // omnibox before the user started editing it, not the search terms.
123     SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT = 9;
124
125     // When adding new classifications, please consider adding them in
126     // chrome/browser/resources/omnibox/omnibox.html
127     // so that these new options are displayed on about:omnibox.
128   }
129   optional PageClassification current_page_classification = 10;
130
131   // What kind of input the user provided.
132   enum InputType {
133     INVALID = 0;        // Empty input (should not reach here)
134     UNKNOWN = 1;        // Valid input whose type cannot be determined
135     REQUESTED_URL = 2;  // DEPRECATED. Input autodetected as UNKNOWN, which the
136                         // user wants to treat as an URL by specifying a
137                         // desired_tld
138     URL = 3;            // Input autodetected as a URL
139     QUERY = 4;          // Input autodetected as a query
140     FORCED_QUERY = 5;   // Input forced to be a query by an initial '?'
141   }
142   optional InputType input_type = 8;
143
144   // An enum used in multiple places below.
145   enum ProviderType {
146     UNKNOWN_PROVIDER = 0;  // Unknown provider (should not reach here)
147     HISTORY_URL = 1;       // URLs in history, or user-typed URLs
148     HISTORY_CONTENTS = 2;  // Matches for page contents of pages in history
149     HISTORY_QUICK = 3;     // Matches for recently or frequently visited pages
150                            // in history
151     SEARCH = 4;            // Search suggestions for the default search engine
152     KEYWORD = 5;           // Keyword-triggered searches
153     BUILTIN = 6;           // Built-in URLs, such as chrome://version
154     SHORTCUTS = 7;         // Recently selected omnibox suggestions
155     EXTENSION_APPS = 8;    // Custom suggestions from extensions and/or apps
156     CONTACT = 9;           // DEPRECATED. The user's contacts
157     BOOKMARK = 10;         // The user's bookmarks
158     ZERO_SUGGEST = 11;     // Suggestions based on the current page
159     // This enum value is currently only used by Android GSA. It represents
160     // a suggestion from the phone.
161     ON_DEVICE = 12;
162   }
163
164   // The result set displayed on the completion popup
165   // Next tag: 6
166   message Suggestion {
167     // Where does this result come from?
168     optional ProviderType provider = 1;
169
170     // What kind of result this is.
171     // This corresponds to the AutocompleteMatch::Type enumeration in
172     // chrome/browser/autocomplete/autocomplete_match.h (except for Android
173     // GSA result types).
174     enum ResultType {
175       UNKNOWN_RESULT_TYPE = 0;    // Unknown type (should not reach here)
176       URL_WHAT_YOU_TYPED = 1;     // The input as a URL
177       HISTORY_URL = 2;            // A past page whose URL contains the input
178       HISTORY_TITLE = 3;          // A past page whose title contains the input
179       HISTORY_BODY = 4;           // A past page whose body contains the input
180       HISTORY_KEYWORD = 5;        // A past page whose keyword contains the
181                                   // input
182       NAVSUGGEST = 6;             // A suggested URL
183       SEARCH_WHAT_YOU_TYPED = 7;  // The input as a search query (with the
184                                   // default engine)
185       SEARCH_HISTORY = 8;         // A past search (with the default engine)
186                                   // containing the input
187       SEARCH_SUGGEST = 9;         // A suggested search (with the default
188                                   // engine) for a query.
189       SEARCH_OTHER_ENGINE = 10;   // A search with a non-default engine
190       EXTENSION_APP = 11;         // An Extension App with a title/url that
191                                   // contains the input
192       CONTACT = 12;               // One of the user's contacts
193       BOOKMARK_TITLE = 13;        // A bookmark whose title contains the input.
194       SEARCH_SUGGEST_ENTITY = 14; // A suggested search for an entity.
195       SEARCH_SUGGEST_INFINITE = 15; // A suggested search to complete the tail
196                                     // of the query.
197       SEARCH_SUGGEST_PERSONALIZED = 16; // A personalized suggested search.
198       SEARCH_SUGGEST_PROFILE = 17;  // A personalized suggested search for a
199                                     // Google+ profile.
200       APP_RESULT = 18;              // Result from an installed app
201                                     // (eg: a gmail email).
202                                     // Used by Android GSA for on-device
203                                     // suggestion logging.
204       APP = 19;                     // An app result (eg: the gmail app).
205                                     // Used by Android GSA for on-device
206                                     // suggestion logging.
207       LEGACY_ON_DEVICE = 20;        // An on-device result from a legacy
208                                     // provider. That is, this result is not
209                                     // from the on-device suggestion provider
210                                     // (go/icing). This field is
211                                     // used by Android GSA for on-device
212                                     // suggestion logging.
213       NAVSUGGEST_PERSONALIZED = 21; // A personalized url.
214     }
215     optional ResultType result_type = 2;
216
217     // The relevance score for this suggestion.
218     optional int32 relevance = 3;
219
220     // How many times this result was typed in / selected from the omnibox.
221     // Only set for some providers and result_types.  At the time of
222     // writing this comment, it is only set for HistoryURL and
223     // HistoryQuickProvider matches.
224     optional int32 typed_count = 5;
225
226     // Whether this item is starred (bookmarked) or not.
227     optional bool is_starred = 4;
228   }
229   repeated Suggestion suggestion = 9;
230
231   // A data structure that holds per-provider information, general information
232   // not associated with a particular result.
233   // Next tag: 6
234   message ProviderInfo {
235     // Which provider generated this ProviderInfo entry.
236     optional ProviderType provider = 1;
237
238     // The provider's done() value, i.e., whether it's completed processing
239     // the query.  Providers which don't do any asynchronous processing
240     // will always be done.
241     optional bool provider_done = 2;
242
243     // The set of field trials that have triggered in the most recent query,
244     // possibly affecting the shown suggestions.  Each element is a hash
245     // of the corresponding field trial name.
246     // See chrome/browser/autocomplete/search_provider.cc for a specific usage
247     // example.
248     repeated fixed32 field_trial_triggered = 3;
249
250     // Same as above except that the set of field trials is a union of all field
251     // trials that have triggered within the current omnibox session including
252     // the most recent query.
253     // See AutocompleteController::ResetSession() for more details on the
254     // definition of a session.
255     // See chrome/browser/autocomplete/search_provider.cc for a specific usage
256     // example.
257     repeated fixed32 field_trial_triggered_in_session = 4;
258
259     // The number of times this provider returned a non-zero number of
260     // suggestions during this omnibox session.
261     // Note that each provider may define a session differently for its
262     // purposes.
263     optional int32 times_returned_results_in_session = 5;
264   }
265   // A list of diagnostic information about each provider.  Providers
266   // will appear at most once in this list.
267   repeated ProviderInfo provider_info = 12;
268 }