feat(NativeWindowMac): addTabbedWindow

Add support for the [`NSWindow addTabbedWindow`][nsw] method on MacOSX

This plays nicely with the changes from #9052 and #9725

Usage samples available in [this commit][c] in my fork of
`electron-quick-start`

[nsw]: 1855947-addtabbedwindow
[c]: 79f06591df
This commit is contained in:
Daniel Ma 2017-09-13 12:15:14 -07:00 committed by Cheng Zhao
parent 68d35dbeb1
commit 1bb042a661
8 changed files with 46 additions and 0 deletions

View file

@ -474,6 +474,7 @@ enum {
@interface NSWindow (SierraSDK)
- (void)setTabbingMode:(NSInteger)mode;
- (void)setTabbingIdentifier:(NSString*)identifier;
- (void)addTabbedWindow:(NSWindow*)window ordered:(NSWindowOrderingMode)ordered;
- (IBAction)selectPreviousTab:(id)sender;
- (IBAction)selectNextTab:(id)sender;
- (IBAction)mergeAllWindows:(id)sender;
@ -1649,6 +1650,12 @@ void NativeWindowMac::ToggleTabBar() {
}
}
void NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)]) {
[window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
}
}
void NativeWindowMac::SetVibrancy(const std::string& type) {
if (!base::mac::IsAtLeastOS10_10()) return;