OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ | 5 #ifndef UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ |
6 #define UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ | 6 #define UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ |
7 | 7 |
8 // Once Chrome no longer supports OSX 10.12.0, this file can be deleted. | 8 // Once Chrome no longer supports OSX 10.12.0, this file can be deleted. |
| 9 #import <AppKit/AppKit.h> |
| 10 #import <Foundation/Foundation.h> |
9 | 11 |
10 #import <Foundation/Foundation.h> | 12 #include "ui/base/ui_base_export.h" |
11 | 13 |
12 #if !defined(MAC_OS_X_VERSION_10_12_1) | 14 #if !defined(MAC_OS_X_VERSION_10_12_1) |
13 | 15 |
14 #pragma clang assume_nonnull begin | 16 #pragma clang assume_nonnull begin |
15 | 17 |
16 @class NSTouchBar, NSTouchBarItem; | 18 @class NSTouchBar, NSTouchBarItem; |
17 @protocol NSTouchBarDelegate; | 19 @protocol NSTouchBarDelegate; |
18 | 20 |
19 typedef float NSTouchBarItemPriority; | 21 typedef float NSTouchBarItemPriority; |
20 static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000; | 22 static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000; |
21 static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal = 0; | 23 static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal = 0; |
22 static const NSTouchBarItemPriority NSTouchBarItemPriorityLow = -1000; | 24 static const NSTouchBarItemPriority NSTouchBarItemPriorityLow = -1000; |
23 | 25 |
24 typedef NSString* NSTouchBarItemIdentifier; | 26 typedef NSString* NSTouchBarItemIdentifier; |
25 typedef NSString* NSTouchBarCustomizationIdentifier; | 27 typedef NSString* NSTouchBarCustomizationIdentifier; |
26 | 28 |
27 static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierFixedSpaceSmall = | |
28 @"NSTouchBarItemIdentifierFixedSpaceSmall"; | |
29 | |
30 static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierFlexibleSpace = | |
31 @"NSTouchBarItemIdentifierFlexibleSpace"; | |
32 | |
33 @interface NSTouchBar : NSObject<NSCoding> | 29 @interface NSTouchBar : NSObject<NSCoding> |
34 | 30 |
35 - (instancetype)init NS_DESIGNATED_INITIALIZER; | 31 - (instancetype)init NS_DESIGNATED_INITIALIZER; |
36 - (nullable instancetype)initWithCoder:(NSCoder*)aDecoder | 32 - (nullable instancetype)initWithCoder:(NSCoder*)aDecoder |
37 NS_DESIGNATED_INITIALIZER; | 33 NS_DESIGNATED_INITIALIZER; |
38 | 34 |
39 @property(copy, nullable) | 35 @property(copy, nullable) |
40 NSTouchBarCustomizationIdentifier customizationIdentifier; | 36 NSTouchBarCustomizationIdentifier customizationIdentifier; |
41 @property(copy) NSArray* customizationAllowedItemIdentifiers; | 37 @property(copy) NSArray* customizationAllowedItemIdentifiers; |
42 @property(copy) NSArray* customizationRequiredItemIdentifiers; | 38 @property(copy) NSArray* customizationRequiredItemIdentifiers; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 86 |
91 @end | 87 @end |
92 | 88 |
93 @protocol NSTouchBarDelegate<NSObject> | 89 @protocol NSTouchBarDelegate<NSObject> |
94 | 90 |
95 @optional | 91 @optional |
96 - (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar | 92 - (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar |
97 makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier; | 93 makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier; |
98 @end | 94 @end |
99 | 95 |
100 #pragma clang assume_nonnull end | |
101 | |
102 #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1 | 96 #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1 |
103 | 97 |
104 // When compiling against the 10.12.1 SDK or later, just provide forward | 98 // When compiling against the 10.12.1 SDK or later, just provide forward |
105 // declarations to suppress the partial availability warnings. | 99 // declarations to suppress the partial availability warnings. |
106 | 100 |
107 @class NSCustomTouchBarItem; | 101 @class NSCustomTouchBarItem; |
108 @class NSGroupTouchBarItem; | 102 @class NSGroupTouchBarItem; |
109 @class NSTouchBar; | 103 @class NSTouchBar; |
110 @protocol NSTouchBarDelegate; | 104 @protocol NSTouchBarDelegate; |
111 @class NSTouchBarItem; | 105 @class NSTouchBarItem; |
112 | 106 |
113 @interface NSWindow (TouchBarSDK) | 107 @interface NSWindow (TouchBarSDK) |
114 @property(strong, readonly) NSTouchBar* touchBar; | 108 @property(strong, readonly) NSTouchBar* touchBar; |
115 @end | 109 @end |
116 | 110 |
117 #endif // MAC_OS_X_VERSION_10_12_1 | 111 #endif // MAC_OS_X_VERSION_10_12_1 |
118 | 112 |
| 113 extern "C" { |
| 114 #if !defined(MAC_OS_X_VERSION_10_12_1) || \ |
| 115 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1 |
| 116 UI_BASE_EXPORT extern NSString* const NSTouchBarItemIdentifierFixedSpaceSmall; |
| 117 UI_BASE_EXPORT extern NSString* const NSTouchBarItemIdentifierFlexibleSpace; |
| 118 #endif // MAC_OS_X_VERSION_10_12_1 |
| 119 } // extern "C" |
| 120 |
| 121 #pragma clang assume_nonnull end |
| 122 |
119 #endif // UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ | 123 #endif // UI_BASE_COCOA_TOUCH_BAR_FORWARD_DECLARATIONS_H_ |
OLD | NEW |