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. 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: 15 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 ChromeUserMetricsExtensionsProto). 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 // 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; 48 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; 55 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; 64 65 // The type of page currently displayed when the user used the omnibox. 66 enum PageClassification { 67 INVALID_SPEC = 0; // invalid URI; shouldn't happen 68 NEW_TAB_PAGE = 1; // chrome://newtab/ 69 // Note that chrome://newtab/ doesn't have to be the built-in 70 // version; it could be replaced by an extension. 71 BLANK = 2; // about:blank 72 HOMEPAGE = 3; // user switched settings to "open this page" mode. 73 // Note that if the homepage is set to the new tab page or about blank, 74 // then we'll classify the web page into those categories, not HOMEPAGE. 75 OTHER = 4; // everything not included somewhere else on this list 76 // The instant new tab page enum value was deprecated on August 2, 2013. 77 OBSOLETE_INSTANT_NEW_TAB_PAGE = 5; 78 // The user is on a search result page that's doing search term 79 // replacement, meaning the search terms should've appeared in the omnibox 80 // before the user started editing it, not the URL of the page. 81 SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT = 6; 82 // The new tab page in which this omnibox interaction first started 83 // with the user having focus in the omnibox. 84 INSTANT_NEW_TAB_PAGE_WITH_OMNIBOX_AS_STARTING_FOCUS = 7; 85 // The new tab page in which this omnibox interaction first started 86 // with the user having focus in the fakebox. 87 INSTANT_NEW_TAB_PAGE_WITH_FAKEBOX_AS_STARTING_FOCUS = 8; 88 // The user is on a search result page that's not doing search term 89 // replacement, meaning the URL of the page should've appeared in the 90 // omnibox before the user started editing it, not the search terms. 91 SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT = 9; 92 } 93 optional PageClassification current_page_classification = 10; 94 95 // What kind of input the user provided. 96 enum InputType { 97 INVALID = 0; // Empty input (should not reach here) 98 UNKNOWN = 1; // Valid input whose type cannot be determined 99 REQUESTED_URL = 2; // DEPRECATED. Input autodetected as UNKNOWN, which the 100 // user wants to treat as an URL by specifying a 101 // desired_tld 102 URL = 3; // Input autodetected as a URL 103 QUERY = 4; // Input autodetected as a query 104 FORCED_QUERY = 5; // Input forced to be a query by an initial '?' 105 } 106 optional InputType input_type = 8; 107 108 // An enum used in multiple places below. 109 enum ProviderType { 110 UNKNOWN_PROVIDER = 0; // Unknown provider (should not reach here) 111 HISTORY_URL = 1; // URLs in history, or user-typed URLs 112 HISTORY_CONTENTS = 2; // Matches for page contents of pages in history 113 HISTORY_QUICK = 3; // Matches for recently or frequently visited pages 114 // in history 115 SEARCH = 4; // Search suggestions for the default search engine 116 KEYWORD = 5; // Keyword-triggered searches 117 BUILTIN = 6; // Built-in URLs, such as chrome://version 118 SHORTCUTS = 7; // Recently selected omnibox suggestions 119 EXTENSION_APPS = 8; // Custom suggestions from extensions and/or apps 120 CONTACT = 9; // The user's contacts 121 BOOKMARK = 10; // The user's bookmarks 122 ZERO_SUGGEST = 11; // Suggestions based on the current page 123 } 124 125 // The result set displayed on the completion popup 126 // Next tag: 6 127 message Suggestion { 128 // Where does this result come from? 129 optional ProviderType provider = 1; 130 131 // What kind of result this is. 132 // This corresponds to the AutocompleteMatch::Type enumeration in 133 // chrome/browser/autocomplete/autocomplete_match.h 134 enum ResultType { 135 UNKNOWN_RESULT_TYPE = 0; // Unknown type (should not reach here) 136 URL_WHAT_YOU_TYPED = 1; // The input as a URL 137 HISTORY_URL = 2; // A past page whose URL contains the input 138 HISTORY_TITLE = 3; // A past page whose title contains the input 139 HISTORY_BODY = 4; // A past page whose body contains the input 140 HISTORY_KEYWORD = 5; // A past page whose keyword contains the 141 // input 142 NAVSUGGEST = 6; // A suggested URL 143 SEARCH_WHAT_YOU_TYPED = 7; // The input as a search query (with the 144 // default engine) 145 SEARCH_HISTORY = 8; // A past search (with the default engine) 146 // containing the input 147 SEARCH_SUGGEST = 9; // A suggested search (with the default 148 // engine) 149 SEARCH_OTHER_ENGINE = 10; // A search with a non-default engine 150 EXTENSION_APP = 11; // An Extension App with a title/url that 151 // contains the input 152 CONTACT = 12; // One of the user's contacts 153 BOOKMARK_TITLE = 13; // A bookmark whose title contains the input. 154 } 155 optional ResultType result_type = 2; 156 157 // The relevance score for this suggestion. 158 optional int32 relevance = 3; 159 160 // How many times this result was typed in / selected from the omnibox. 161 // Only set for some providers and result_types. At the time of 162 // writing this comment, it is only set for HistoryURL and 163 // HistoryQuickProvider matches. 164 optional int32 typed_count = 5; 165 166 // Whether this item is starred (bookmarked) or not. 167 optional bool is_starred = 4; 168 } 169 repeated Suggestion suggestion = 9; 170 171 // A data structure that holds per-provider information, general information 172 // not associated with a particular result. 173 // Next tag: 5 174 message ProviderInfo { 175 // Which provider generated this ProviderInfo entry. 176 optional ProviderType provider = 1; 177 178 // The provider's done() value, i.e., whether it's completed processing 179 // the query. Providers which don't do any asynchronous processing 180 // will always be done. 181 optional bool provider_done = 2; 182 183 // The set of field trials that have triggered in the most recent query, 184 // possibly affecting the shown suggestions. Each element is a hash 185 // of the corresponding field trial name. 186 // See chrome/browser/autocomplete/search_provider.cc for a specific usage 187 // example. 188 repeated fixed32 field_trial_triggered = 3; 189 190 // Same as above except that the set of field trials is a union of all field 191 // trials that have triggered within the current omnibox session including 192 // the most recent query. 193 // See AutocompleteController::ResetSession() for more details on the 194 // definition of a session. 195 // See chrome/browser/autocomplete/search_provider.cc for a specific usage 196 // example. 197 repeated fixed32 field_trial_triggered_in_session = 4; 198 } 199 // A list of diagnostic information about each provider. Providers 200 // will appear at most once in this list. 201 repeated ProviderInfo provider_info = 12; 202 } 203