blob: 457099bd9a5b6bb9b462c0454d7e18a2693f03b1 [file] [log] [blame]
spqchan69b67522017-06-07 20:56:561// 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 Drissman111a0c02020-01-27 21:18:169#include <os/availability.h>
spqchan69b67522017-06-07 20:56:5610
spqchan69b67522017-06-07 20:56:5611#include "ui/base/ui_base_export.h"
12
13namespace ui {
14
spqchand24dbd52017-07-21 00:57:0615// The touch bar actions that are being recorded in a histogram. These values
16// should not be re-ordered or removed.
17enum TouchBarAction {
18 BACK = 0,
19 FORWARD,
20 STOP,
21 RELOAD,
22 HOME,
23 SEARCH,
24 STAR,
25 NEW_TAB,
26 CREDIT_CARD_AUTOFILL,
Tessa Nijssenc67abee2018-07-19 18:45:4927 TEXT_SUGGESTION,
spqchand24dbd52017-07-21 00:57:0628 TOUCH_BAR_ACTION_COUNT
29};
30
31// Logs the sample's UMA metrics into the DefaultTouchBar.Metrics histogram.
32UI_BASE_EXPORT void LogTouchBarUMA(TouchBarAction command);
33
spqchan69b67522017-06-07 20:56:5634// Returns the NSTouchBar Class.
35UI_BASE_EXPORT Class NSTouchBar();
36
37// Returns the NSCustomTouchBarItem Class.
38UI_BASE_EXPORT Class NSCustomTouchBarItem();
39
spqchand24dbd52017-07-21 00:57:0640// Returns the NSGroupTouchBarItem Class.
41UI_BASE_EXPORT Class NSGroupTouchBarItem();
42
spqchan69b67522017-06-07 20:56:5643// Returns a stylized blue button for the touch bar. The button performs
44// |action| from the |target|.
erikchend2b3c762017-07-18 00:12:4845API_AVAILABLE(macosx(10.12.2))
spqchan69b67522017-06-07 20:56:5646UI_BASE_EXPORT NSButton* GetBlueTouchBarButton(NSString* title,
47 id target,
48 SEL action);
49
50// Creates a touch bar identifier with the given |id|.
51UI_BASE_EXPORT NSString* GetTouchBarId(NSString* touch_bar_id);
52
53// Creates a touch Bar jtem identifier.
54UI_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