Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: ui/base/cocoa/touch_bar_util.mm

Issue 2921083003: [Mac] Touch Bar Support for Dialogs (Closed)
Patch Set: Added test and renamed methods Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/cocoa/touch_bar_util.h ('k') | ui/base/cocoa/touch_bar_util_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #import "ui/base/cocoa/touch_bar_util.h"
6
7 #include "base/mac/foundation_util.h"
8 #include "base/mac/sdk_forward_declarations.h"
9 #include "base/strings/sys_string_conversions.h"
10
11 namespace ui {
12
13 Class NSTouchBar() {
14 return NSClassFromString(@"NSTouchBar");
15 }
16
17 Class NSCustomTouchBarItem() {
18 return NSClassFromString(@"NSCustomTouchBarItem");
19 }
20
21 NSButton* GetBlueTouchBarButton(NSString* title, id target, SEL action) {
22 NSButton* button =
23 [NSButton buttonWithTitle:title target:target action:action];
24 [button setBezelColor:[NSColor colorWithSRGBRed:0.168
25 green:0.51
26 blue:0.843
27 alpha:1.0]];
28 return button;
29 }
30
31 NSString* GetTouchBarId(NSString* touch_bar_id) {
32 NSString* chrome_bundle_id =
33 base::SysUTF8ToNSString(base::mac::BaseBundleID());
34 return [NSString stringWithFormat:@"%@.%@", chrome_bundle_id, touch_bar_id];
35 }
36
37 NSString* GetTouchBarItemId(NSString* touch_bar_id, NSString* item_id) {
38 return [NSString
39 stringWithFormat:@"%@-%@", GetTouchBarId(touch_bar_id), item_id];
40 }
41
42 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cocoa/touch_bar_util.h ('k') | ui/base/cocoa/touch_bar_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698