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

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

Issue 2921083003: [Mac] Touch Bar Support for Dialogs (Closed)
Patch Set: nits 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
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"
Robert Sesek 2017/06/06 14:52:36 nit: blank line after
spqchan 2017/06/06 19:34:51 Done.
6 #include "base/mac/foundation_util.h"
7 #include "base/mac/sdk_forward_declarations.h"
8 #include "base/strings/sys_string_conversions.h"
9
10 namespace ui {
11
12 NSButton* CreateBlueTouchBarButton(NSString* title, id target, SEL action) {
13 NSButton* button =
14 [NSButton buttonWithTitle:title target:target action:action];
15 [button setBezelColor:[NSColor colorWithSRGBRed:0.168
16 green:0.51
17 blue:0.843
18 alpha:1.0]];
19 return button;
20 }
21
22 NSString* CreateTouchBarId(NSString* touch_bar_id) {
23 NSString* chrome_bundle_id =
24 base::SysUTF8ToNSString(base::mac::BaseBundleID());
25 return [NSString stringWithFormat:@"%@.%@", chrome_bundle_id, touch_bar_id];
26 }
27
28 NSString* CreateTouchBarItemId(NSString* touch_bar_id, NSString* item_id) {
29 return [NSString
30 stringWithFormat:@"%@-%@", CreateTouchBarId(touch_bar_id), item_id];
31 }
32
33 } // namespace ui
OLDNEW
« ui/base/cocoa/touch_bar_util.h ('K') | « ui/base/cocoa/touch_bar_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698