1 // Copyright 2019 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 #ifndef ASH_PUBLIC_CPP_APP_LIST_APP_LIST_METRICS_H_
6 #define ASH_PUBLIC_CPP_APP_LIST_APP_LIST_METRICS_H_
7 
8 #include "ash/public/cpp/ash_public_export.h"
9 
10 namespace ash {
11 enum class AppListLaunchedFrom;
12 
13 // The type of the ChromeSearchResult. This is used for logging so do not
14 // change the order of this enum. If you add to this enum update
15 // AppListSearchResult in enums.xml.
16 enum SearchResultType {
17   // A result that forwards an omnibox search result. Use or create OMNIBOX_*
18   // instead (Deprecated).
19   OMNIBOX_SEARCH_RESULT_DEPRECATED,
20   // An app result. Use or create platform specific types below (Deprecated).
21   APP_SEARCH_RESULT_DEPRECATED,
22   // A search result from the webstore (Deprecated).
23   WEBSTORE_SEARCH_RESULT_DEPRECATED,
24   // A result that opens a webstore search (Deprecated)
25   SEARCH_WEBSTORE_SEARCH_RESULT_DEPRECATED,
26   // A result that opens a people search (Deprecated).
27   SEARCH_PEOPLE_SEARCH_RESULT_DEPRECATED,
28   // A result that opens a suggestion (Deprecated).
29   SUGGESTIONS_SEARCH_RESULT_DEPRECATED,
30   // A result which is either a local file or drive file.
31   LAUNCHER_SEARCH_PROVIDER_RESULT,
32   // A result that is an uninstalled app from a Play Store app search.
33   PLAY_STORE_UNINSTALLED_APP,
34   // A result that is an instant app from a Play Store app search.
35   PLAY_STORE_INSTANT_APP,
36   // A result that is an answer card.
37   ANSWER_CARD,
38   // A result that opens a specific activity in an app installed from Play
39   // Store.
40   PLAY_STORE_APP_SHORTCUT,
41   // A result that is a URL.
42   OMNIBOX_URL_WHAT_YOU_TYPED,
43   // A result which is a bookmark.
44   OMNIBOX_BOOKMARK,
45   // A result which is a recently visited website.
46   OMNIBOX_RECENTLY_VISITED_WEBSITE,
47   // A result which is a recently used doc in drive.
48   OMNIBOX_RECENT_DOC_IN_DRIVE,
49   // A result which is a web query.
50   OMNIBOX_WEB_QUERY,
51   // A result which was a web query that was previously searched.
52   // This should be deprecated after M76.
53   OMNIBOX_HISTORY_DEPRECATED,
54   // An app result which is an installed playstore app.
55   PLAY_STORE_APP,
56   // An app result which is an app that was installed on another device.
57   PLAY_STORE_REINSTALL_APP,
58   // An app result which is an internal app (files, settings, etc).
59   INTERNAL_APP,
60   // An app result which is an extension.
61   EXTENSION_APP,
62   // A Crostini App Result.
63   CROSTINI_APP,
64   // An app result which is a quick action in settings.
65   SETTINGS_SHORTCUT,
66   // An ArcAppDataSearchResult which is a person from contacts.
67   APP_DATA_RESULT_PERSON,
68   // An ArcAppDataSearchResult which is a note document.
69   APP_DATA_RESULT_NOTE_DOCUMENT,
70   // An omnibox result which is opened via the assistant.
71   ASSISTANT_OMNIBOX_RESULT,
72   // A result from omnibox for the query that was previously searched.
73   OMNIBOX_SEARCH_HISTORY,
74   // A result from omnibox for query suggestion.
75   OMNIBOX_SEARCH_SUGGEST,
76   // A result from omnibox for the personalized suggestion.
77   // Currently, it is used for the user's recent query.
78   OMNIBOX_SUGGEST_PERSONALIZED,
79   // A zero-state result representing a local file.
80   ZERO_STATE_FILE,
81   // A result from the Drive QuickAccess provider.
82   DRIVE_QUICK_ACCESS,
83   // A result from the Assistant provider.
84   ASSISTANT,
85   // An OsSettingsResult.
86   OS_SETTINGS,
87   // A Plugin VM App Result.
88   PLUGIN_VM_APP,
89   // LaCrOS binary.
90   LACROS,
91   // A Remote App Result.
92   REMOTE_APP,
93   // A Borealis App Result.
94   BOREALIS_APP,
95   // A Help App (aka Explore) Result.
96   HELP_APP,
97   // Boundary is always last.
98   SEARCH_RESULT_TYPE_BOUNDARY
99 };
100 
101 ASH_PUBLIC_EXPORT void RecordSearchResultOpenTypeHistogram(
102     AppListLaunchedFrom launch_location,
103     SearchResultType type,
104     bool is_tablet_mode);
105 
106 ASH_PUBLIC_EXPORT void RecordDefaultSearchResultOpenTypeHistogram(
107     SearchResultType type);
108 
109 ASH_PUBLIC_EXPORT void RecordZeroStateSuggestionOpenTypeHistogram(
110     SearchResultType type);
111 
112 ASH_PUBLIC_EXPORT void RecordLauncherIssuedSearchQueryLength(int query_length);
113 
114 ASH_PUBLIC_EXPORT void RecordLauncherClickedSearchQueryLength(int query_length);
115 
116 ASH_PUBLIC_EXPORT void RecordSuccessfulAppLaunchUsingSearch(
117     AppListLaunchedFrom launched_from,
118     int query_length);
119 
120 }  // namespace ash
121 
122 #endif  // ASH_PUBLIC_CPP_APP_LIST_APP_LIST_METRICS_H_
123