spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 1 | // Copyright 2017 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 | |
Lei Zhang | 7fc035b4 | 2021-04-20 20:03:19 | [diff] [blame] | 5 | #ifndef UI_BASE_COCOA_TOUCH_BAR_UTIL_H_ |
| 6 | #define UI_BASE_COCOA_TOUCH_BAR_UTIL_H_ |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 7 | |
| 8 | #import <Cocoa/Cocoa.h> |
Avi Drissman | 111a0c0 | 2020-01-27 21:18:16 | [diff] [blame] | 9 | #include <os/availability.h> |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 10 | |
Henrique Ferreiro | 376c765 | 2020-05-22 09:00:04 | [diff] [blame] | 11 | #include "base/component_export.h" |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 12 | |
| 13 | namespace ui { |
| 14 | |
spqchan | d24dbd5 | 2017-07-21 00:57:06 | [diff] [blame] | 15 | // The touch bar actions that are being recorded in a histogram. These values |
| 16 | // should not be re-ordered or removed. |
| 17 | enum TouchBarAction { |
| 18 | BACK = 0, |
| 19 | FORWARD, |
| 20 | STOP, |
| 21 | RELOAD, |
| 22 | HOME, |
| 23 | SEARCH, |
| 24 | STAR, |
| 25 | NEW_TAB, |
| 26 | CREDIT_CARD_AUTOFILL, |
Tessa Nijssen | c67abee | 2018-07-19 18:45:49 | [diff] [blame] | 27 | TEXT_SUGGESTION, |
spqchan | d24dbd5 | 2017-07-21 00:57:06 | [diff] [blame] | 28 | TOUCH_BAR_ACTION_COUNT |
| 29 | }; |
| 30 | |
| 31 | // Logs the sample's UMA metrics into the DefaultTouchBar.Metrics histogram. |
Henrique Ferreiro | 376c765 | 2020-05-22 09:00:04 | [diff] [blame] | 32 | COMPONENT_EXPORT(UI_BASE) void LogTouchBarUMA(TouchBarAction command); |
spqchan | d24dbd5 | 2017-07-21 00:57:06 | [diff] [blame] | 33 | |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 34 | // Creates a touch bar identifier with the given |id|. |
Henrique Ferreiro | 376c765 | 2020-05-22 09:00:04 | [diff] [blame] | 35 | COMPONENT_EXPORT(UI_BASE) NSString* GetTouchBarId(NSString* touch_bar_id); |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 36 | |
| 37 | // Creates a touch Bar jtem identifier. |
Henrique Ferreiro | 376c765 | 2020-05-22 09:00:04 | [diff] [blame] | 38 | COMPONENT_EXPORT(UI_BASE) |
| 39 | NSString* GetTouchBarItemId(NSString* touch_bar_id, NSString* item_id); |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 40 | |
| 41 | } // namespace ui |
| 42 | |
Lei Zhang | 7fc035b4 | 2021-04-20 20:03:19 | [diff] [blame] | 43 | #endif // UI_BASE_COCOA_TOUCH_BAR_UTIL_H_ |