Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |