| Index: ui/base/cocoa/touch_bar_forward_declarations.h
|
| diff --git a/ui/base/cocoa/touch_bar_forward_declarations.h b/ui/base/cocoa/touch_bar_forward_declarations.h
|
| index 54c68ae534ba473664f61d8cdc69de1982752224..6a4acd115775ef7e760d2804ecff3483a2b1d64a 100644
|
| --- a/ui/base/cocoa/touch_bar_forward_declarations.h
|
| +++ b/ui/base/cocoa/touch_bar_forward_declarations.h
|
| @@ -11,38 +11,91 @@
|
|
|
| #if !defined(MAC_OS_X_VERSION_10_12_1)
|
|
|
| -// The TouchBar classes do not exist at all without the 10.12.1 SDK. When
|
| -// compiling with older SDKs, pretend they are NSObject and add categories to
|
| -// NSObject to expose the methods.
|
| // To alloc one of these classes, use -[NSClassFromString(@"..") alloc].
|
|
|
| // Incomplete. Add more as necessary.
|
|
|
| -typedef NSObject NSCustomTouchBarItem;
|
| -typedef NSObject NSGroupTouchBarItem;
|
| -typedef NSObject NSTouchBar;
|
| -typedef NSObject NSTouchBarItem;
|
| +NS_ASSUME_NONNULL_BEGIN
|
| +
|
| +@protocol NSTouchBarDelegate;
|
| +@class NSTouchBarItem;
|
| +
|
| +typedef float NSTouchBarItemPriority;
|
| +static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000;
|
| +static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal = 0;
|
| +static const NSTouchBarItemPriority NSTouchBarItemPriorityLow = -1000;
|
| +
|
| typedef NSString* NSTouchBarItemIdentifier;
|
| +typedef NSString* NSTouchBarCustomizationIdentifier;
|
| +
|
| +@interface NSTouchBar : NSObject<NSCoding>
|
| +
|
| +- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
| +- (nullable instancetype)initWithCoder:(NSCoder*)aDecoder
|
| + NS_DESIGNATED_INITIALIZER;
|
| +
|
| +@property(copy, nullable)
|
| + NSTouchBarCustomizationIdentifier customizationIdentifier;
|
| +@property(copy) NSArray* customizationAllowedItemIdentifiers;
|
| +@property(copy) NSArray* customizationRequiredItemIdentifiers;
|
| +@property(copy) NSArray* defaultItemIdentifiers;
|
| +@property(copy, readonly) NSArray* itemIdentifiers;
|
| +@property(copy, nullable) NSTouchBarItemIdentifier principalItemIdentifier;
|
| +@property(copy) NSSet* templateItems;
|
| +@property(nullable, weak) id<NSTouchBarDelegate> delegate;
|
| +
|
| +- (nullable __kindof NSTouchBarItem*)itemForIdentifier:
|
| + (NSTouchBarItemIdentifier)identifier;
|
| +
|
| +@property(readonly, getter=isVisible) BOOL visible;
|
|
|
| -@protocol NSTouchBarDelegate<NSObject>
|
| @end
|
|
|
| -@interface NSObject (FakeNSCustomTouchBarItem)
|
| -@property(readwrite, strong) NSView* view;
|
| +@interface NSTouchBarItem : NSObject<NSCoding>
|
| +
|
| +- (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier
|
| + NS_DESIGNATED_INITIALIZER;
|
| +- (nullable instancetype)initWithCoder:(NSCoder*)coder
|
| + NS_DESIGNATED_INITIALIZER;
|
| +- (instancetype)init NS_UNAVAILABLE;
|
| +
|
| +@property(readonly, copy) NSTouchBarItemIdentifier identifier;
|
| +@property NSTouchBarItemPriority visibilityPriority;
|
| +@property(readonly, nullable) NSView* view;
|
| +@property(readonly, nullable) NSViewController* viewController;
|
| +@property(readonly, copy) NSString* customizationLabel;
|
| +@property(readonly, getter=isVisible) BOOL visible;
|
| +
|
| @end
|
|
|
| -@interface NSObject (FakeNSGroupTouchBarItem)
|
| +@interface NSGroupTouchBarItem : NSTouchBarItem
|
| +
|
| + (NSGroupTouchBarItem*)groupItemWithIdentifier:
|
| (NSTouchBarItemIdentifier)identifier
|
| items:(NSArray*)items;
|
| +
|
| +@property(retain) NSTouchBar* groupTouchBar;
|
| +@property(readwrite, copy, null_resettable) NSString* customizationLabel;
|
| +
|
| @end
|
|
|
| -@interface NSObject (FakeNSTouchBar)
|
| -@property(copy) NSArray* defaultItemIdentifiers;
|
| -@property(copy) NSTouchBarItemIdentifier principalItemIdentifier;
|
| -@property(weak) id<NSTouchBarDelegate> delegate;
|
| +@interface NSCustomTouchBarItem : NSTouchBarItem
|
| +
|
| +@property(readwrite, retain) __kindof NSView* view;
|
| +@property(readwrite, retain, nullable)
|
| + __kindof NSViewController* viewController;
|
| +@property(readwrite, copy, null_resettable) NSString* customizationLabel;
|
| +
|
| +@end
|
| +
|
| +@protocol NSTouchBarDelegate<NSObject>
|
| +@optional
|
| +- (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
|
| + makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier;
|
| @end
|
|
|
| +NS_ASSUME_NONNULL_END
|
| +
|
| #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
|
|
|
| // When compiling against the 10.12.1 SDK or later, just provide forward
|
|
|