OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ | 5 #ifndef CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ |
6 #define CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ | 6 #define CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "chrome/browser/autocomplete/autocomplete_input.h" | 12 #include "chrome/browser/autocomplete/autocomplete_input.h" |
13 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 13 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
14 #include "chrome/browser/sessions/session_id.h" | 14 #include "chrome/browser/sessions/session_id.h" |
15 #include "components/metrics/proto/omnibox_input_type.pb.h" | |
16 | 15 |
17 class AutocompleteResult; | 16 class AutocompleteResult; |
18 | 17 |
19 // The data to log (via the metrics service) when the user selects an item from | 18 // The data to log (via the metrics service) when the user selects an item from |
20 // the omnibox popup. | 19 // the omnibox popup. |
21 struct OmniboxLog { | 20 struct OmniboxLog { |
22 OmniboxLog( | 21 OmniboxLog( |
23 const base::string16& text, | 22 const base::string16& text, |
24 bool just_deleted_text, | 23 bool just_deleted_text, |
25 metrics::OmniboxInputType::Type input_type, | 24 AutocompleteInput::Type input_type, |
26 bool is_popup_open, | 25 bool is_popup_open, |
27 size_t selected_index, | 26 size_t selected_index, |
28 bool is_paste_and_go, | 27 bool is_paste_and_go, |
29 SessionID::id_type tab_id, | 28 SessionID::id_type tab_id, |
30 AutocompleteInput::PageClassification current_page_classification, | 29 AutocompleteInput::PageClassification current_page_classification, |
31 base::TimeDelta elapsed_time_since_user_first_modified_omnibox, | 30 base::TimeDelta elapsed_time_since_user_first_modified_omnibox, |
32 size_t completed_length, | 31 size_t completed_length, |
33 base::TimeDelta elapsed_time_since_last_change_to_default_match, | 32 base::TimeDelta elapsed_time_since_last_change_to_default_match, |
34 const AutocompleteResult& result); | 33 const AutocompleteResult& result); |
35 ~OmniboxLog(); | 34 ~OmniboxLog(); |
36 | 35 |
37 // The user's input text in the omnibox. | 36 // The user's input text in the omnibox. |
38 base::string16 text; | 37 base::string16 text; |
39 | 38 |
40 // Whether the user deleted text immediately before selecting an omnibox | 39 // Whether the user deleted text immediately before selecting an omnibox |
41 // suggestion. This is usually the result of pressing backspace or delete. | 40 // suggestion. This is usually the result of pressing backspace or delete. |
42 bool just_deleted_text; | 41 bool just_deleted_text; |
43 | 42 |
44 // The detected type of the user's input. | 43 // The detected type of the user's input. |
45 metrics::OmniboxInputType::Type input_type; | 44 AutocompleteInput::Type input_type; |
46 | 45 |
47 // True if the popup is open. | 46 // True if the popup is open. |
48 bool is_popup_open; | 47 bool is_popup_open; |
49 | 48 |
50 // The index of the item selected in the dropdown list. Set to 0 if the | 49 // The index of the item selected in the dropdown list. Set to 0 if the |
51 // dropdown is closed (and therefore there is only one implicit suggestion). | 50 // dropdown is closed (and therefore there is only one implicit suggestion). |
52 size_t selected_index; | 51 size_t selected_index; |
53 | 52 |
54 // True if this is a paste-and-search or paste-and-go omnibox interaction. | 53 // True if this is a paste-and-search or paste-and-go omnibox interaction. |
55 // (The codebase refers to both these types as paste-and-go.) | 54 // (The codebase refers to both these types as paste-and-go.) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Result set. | 89 // Result set. |
91 const AutocompleteResult& result; | 90 const AutocompleteResult& result; |
92 | 91 |
93 // Diagnostic information from providers. See | 92 // Diagnostic information from providers. See |
94 // AutocompleteController::AddProvidersInfo() and | 93 // AutocompleteController::AddProvidersInfo() and |
95 // AutocompleteProvider::AddProviderInfo() above. | 94 // AutocompleteProvider::AddProviderInfo() above. |
96 ProvidersInfo providers_info; | 95 ProvidersInfo providers_info; |
97 }; | 96 }; |
98 | 97 |
99 #endif // CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ | 98 #endif // CHROME_BROWSER_OMNIBOX_OMNIBOX_LOG_H_ |
OLD | NEW |