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 | |
| 5 | #ifndef UI_BASE_COCOA_TOUCH_BAR_UTIL_H |
| 6 | #define UI_BASE_COCOA_TOUCH_BAR_UTIL_H |
| 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 | |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 11 | #include "ui/base/ui_base_export.h" |
| 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. |
| 32 | UI_BASE_EXPORT void LogTouchBarUMA(TouchBarAction command); |
| 33 | |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 34 | // Returns the NSTouchBar Class. |
| 35 | UI_BASE_EXPORT Class NSTouchBar(); |
| 36 | |
| 37 | // Returns the NSCustomTouchBarItem Class. |
| 38 | UI_BASE_EXPORT Class NSCustomTouchBarItem(); |
| 39 | |
spqchan | d24dbd5 | 2017-07-21 00:57:06 | [diff] [blame] | 40 | // Returns the NSGroupTouchBarItem Class. |
| 41 | UI_BASE_EXPORT Class NSGroupTouchBarItem(); |
| 42 | |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 43 | // Returns a stylized blue button for the touch bar. The button performs |
| 44 | // |action| from the |target|. |
erikchen | d2b3c76 | 2017-07-18 00:12:48 | [diff] [blame] | 45 | API_AVAILABLE(macosx(10.12.2)) |
spqchan | 69b6752 | 2017-06-07 20:56:56 | [diff] [blame] | 46 | UI_BASE_EXPORT NSButton* GetBlueTouchBarButton(NSString* title, |
| 47 | id target, |
| 48 | SEL action); |
| 49 | |
| 50 | // Creates a touch bar identifier with the given |id|. |
| 51 | UI_BASE_EXPORT NSString* GetTouchBarId(NSString* touch_bar_id); |
| 52 | |
| 53 | // Creates a touch Bar jtem identifier. |
| 54 | UI_BASE_EXPORT NSString* GetTouchBarItemId(NSString* touch_bar_id, |
| 55 | NSString* item_id); |
| 56 | |
| 57 | } // namespace ui |
| 58 | |
| 59 | #endif // UI_BASE_COCOA_TOUCH_BAR_UTIL_H |