Compare commits

...

10 Commits

Author SHA1 Message Date
John Kleinschmidt
1b2a85436c Bump v3.0.0-beta.1 2018-06-20 12:52:49 -04:00
John Kleinschmidt
c7d4d2d18f Set to last version released
Need to properly bump version
2018-06-20 12:52:33 -04:00
John Kleinschmidt
d1a0eb3d11 Merge pull request #13339 from trop-bot/3-0-x-bp-fix-linking-error-for-mas-build-1529503586342
Backport (3-0-x) - Fix linking error for MAS build
2018-06-20 11:00:35 -04:00
trop[bot]
a0e37d1383 Backport (3-0-x) - test: Upgrade spec dependencies (#13328)
* package: Update mocha, mocha-junit-reporter

* package: Update graceful-fs, multiparty, q, walkdir

* package: Update basic-auth

* package: Update ws

* package: Update dbus-native

* package: Upgrade yargs

* lock: Run `npm audit fix`

* wrench: Fix websocket API change
2018-06-20 09:24:27 -05:00
trop[bot]
128a03450a Backport (3-0-x) - fix: tls check shouldnt rely on an external service (#13338)
* fix: tls check shouldnt rely on an external service

* fix linting in the tls script'
2018-06-21 00:12:58 +10:00
Cheng Zhao
d34c7396ef fix: link with crashpad_client for MAS build 2018-06-20 14:06:32 +00:00
John Kleinschmidt
cdbd4792e3 Merge pull request #13336 from trop-bot/3-0-x-bp-revert-"fix--drop-support-for-os-x-mavericks-(version-10.9)"-1529497748886
Backport (3-0-x) - Revert "fix: Drop support for OS X Mavericks (version 10.9)"
2018-06-20 09:07:46 -04:00
Samuel Attard
b0f6c3ab65 Revert "fix: Drop support for OS X Mavericks (version 10.9)" 2018-06-20 12:29:14 +00:00
trop[bot]
d2508faea8 Disable node options in node config (#13323) 2018-06-20 17:10:37 +10:00
trop[bot]
9bda7d0b73 set mac protocol to none (#13326) 2018-06-20 17:10:23 +10:00
30 changed files with 785 additions and 650 deletions

View File

@@ -78,6 +78,11 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
}
}
// No other app was found set it to none instead of setting it back to itself.
if ([identifier isEqualToString:(__bridge NSString*)other]) {
other = base::mac::NSToCFCast(@"None");
}
OSStatus return_code = LSSetDefaultHandlerForURLScheme(protocol_cf, other);
return return_code == noErr;
}
@@ -142,9 +147,13 @@ void Browser::SetUserActivity(const std::string& type,
}
std::string Browser::GetCurrentActivityType() {
NSUserActivity* userActivity =
[[AtomApplication sharedApplication] getCurrentActivity];
return base::SysNSStringToUTF8(userActivity.activityType);
if (@available(macOS 10.10, *)) {
NSUserActivity* userActivity =
[[AtomApplication sharedApplication] getCurrentActivity];
return base::SysNSStringToUTF8(userActivity.activityType);
} else {
return std::string();
}
}
void Browser::InvalidateCurrentActivity() {

View File

@@ -11,7 +11,7 @@
NSUserActivityDelegate> {
@private
BOOL handlingSendEvent_;
base::scoped_nsobject<NSUserActivity> currentActivity_;
base::scoped_nsobject<NSUserActivity> currentActivity_ API_AVAILABLE(macosx(10.10));
NSCondition* handoffLock_;
BOOL updateReceived_;
base::Callback<bool()> shouldShutdown_;
@@ -27,7 +27,7 @@
// CrAppControlProtocol:
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
- (NSUserActivity*)getCurrentActivity;
- (NSUserActivity*)getCurrentActivity API_AVAILABLE(macosx(10.10));
- (void)setCurrentActivity:(NSString*)type
withUserInfo:(NSDictionary*)userInfo
withWebpageURL:(NSURL*)webpageURL;

View File

@@ -58,13 +58,15 @@ inline void dispatch_sync_main(dispatch_block_t block) {
- (void)setCurrentActivity:(NSString*)type
withUserInfo:(NSDictionary*)userInfo
withWebpageURL:(NSURL*)webpageURL {
currentActivity_ = base::scoped_nsobject<NSUserActivity>(
[[NSUserActivity alloc] initWithActivityType:type]);
[currentActivity_ setUserInfo:userInfo];
[currentActivity_ setWebpageURL:webpageURL];
[currentActivity_ setDelegate:self];
[currentActivity_ becomeCurrent];
[currentActivity_ setNeedsSave:YES];
if (@available(macOS 10.10, *)) {
currentActivity_ = base::scoped_nsobject<NSUserActivity>(
[[NSUserActivity alloc] initWithActivityType:type]);
[currentActivity_ setUserInfo:userInfo];
[currentActivity_ setWebpageURL:webpageURL];
[currentActivity_ setDelegate:self];
[currentActivity_ becomeCurrent];
[currentActivity_ setNeedsSave:YES];
}
}
- (NSUserActivity*)getCurrentActivity {
@@ -90,7 +92,8 @@ inline void dispatch_sync_main(dispatch_block_t block) {
[handoffLock_ unlock];
}
- (void)userActivityWillSave:(NSUserActivity*)userActivity {
- (void)userActivityWillSave:(NSUserActivity*)userActivity
API_AVAILABLE(macosx(10.10)) {
__block BOOL shouldWait = NO;
dispatch_sync_main(^{
std::string activity_type(
@@ -118,7 +121,8 @@ inline void dispatch_sync_main(dispatch_block_t block) {
[userActivity setNeedsSave:YES];
}
- (void)userActivityWasContinued:(NSUserActivity*)userActivity {
- (void)userActivityWasContinued:(NSUserActivity*)userActivity
API_AVAILABLE(macosx(10.10)) {
dispatch_async(dispatch_get_main_queue(), ^{
std::string activity_type(
base::SysNSStringToUTF8(userActivity.activityType));

View File

@@ -98,7 +98,8 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
- (BOOL)application:(NSApplication*)sender
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:
(void (^)(NSArray* restorableObjects))restorationHandler {
(void (^)(NSArray* restorableObjects))restorationHandler
API_AVAILABLE(macosx(10.10)) {
std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType));
std::unique_ptr<base::DictionaryValue> user_info =
atom::NSDictionaryToDictionaryValue(userActivity.userInfo);

View File

@@ -153,6 +153,8 @@ class NativeWindowMac : public NativeWindow {
private:
void InternalSetParentWindow(NativeWindow* parent, bool attach);
void ShowWindowButton(NSWindowButton button);
void SetForwardMouseMessages(bool forward);
AtomNSWindow* window_; // Weak ref, managed by widget_.

View File

@@ -295,9 +295,11 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
}
NSUInteger styleMask = NSTitledWindowMask;
if (title_bar_style_ == CUSTOM_BUTTONS_ON_HOVER &&
(!useStandardWindow || transparent() || !has_frame())) {
styleMask = NSFullSizeContentViewWindowMask;
if (@available(macOS 10.10, *)) {
if (title_bar_style_ == CUSTOM_BUTTONS_ON_HOVER &&
(!useStandardWindow || transparent() || !has_frame())) {
styleMask = NSFullSizeContentViewWindowMask;
}
}
if (minimizable) {
styleMask |= NSMiniaturizableWindowMask;
@@ -352,10 +354,11 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
[window_ setDisableKeyOrMainWindow:YES];
if (transparent() || !has_frame()) {
// Don't show title bar.
[window_ setTitlebarAppearsTransparent:YES];
[window_ setTitleVisibility:NSWindowTitleHidden];
if (@available(macOS 10.10, *)) {
// Don't show title bar.
[window_ setTitlebarAppearsTransparent:YES];
[window_ setTitleVisibility:NSWindowTitleHidden];
}
// Remove non-transparent corners, see http://git.io/vfonD.
[window_ setOpaque:NO];
}
@@ -374,15 +377,22 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
// Hide the title bar background
if (title_bar_style_ != NORMAL) {
[window_ setTitlebarAppearsTransparent:YES];
if (@available(macOS 10.10, *)) {
[window_ setTitlebarAppearsTransparent:YES];
}
}
// Hide the title bar.
if (title_bar_style_ == HIDDEN_INSET) {
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
[toolbar setShowsBaselineSeparator:NO];
[window_ setToolbar:toolbar];
if (@available(macOS 10.10, *)) {
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
[toolbar setShowsBaselineSeparator:NO];
[window_ setToolbar:toolbar];
} else {
[window_ enableWindowButtonsOffset];
[window_ setWindowButtonsOffset:NSMakePoint(12, 10)];
}
}
// Resize to content bounds.
@@ -435,8 +445,9 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
SetContentView(new views::View());
// Make sure the bottom corner is rounded for non-modal windows:
// http://crbug.com/396264.
if (!is_modal()) {
// http://crbug.com/396264. But do not enable it on OS X 10.9 for transparent
// window, otherwise a semi-transparent frame would show.
if (!(transparent() && base::mac::IsOS10_9()) && !is_modal()) {
base::scoped_nsobject<CALayer> background_layer([[CALayer alloc] init]);
[background_layer
setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
@@ -468,6 +479,11 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
[[window_ contentView] addSubview:buttons_view_];
} else {
if (title_bar_style_ != NORMAL) {
if (base::mac::IsOS10_9()) {
ShowWindowButton(NSWindowZoomButton);
ShowWindowButton(NSWindowMiniaturizeButton);
ShowWindowButton(NSWindowCloseButton);
}
return;
}
@@ -842,11 +858,17 @@ void NativeWindowMac::Invalidate() {
}
void NativeWindowMac::SetTitle(const std::string& title) {
// For macOS <= 10.9, the setTitleVisibility API is not available, we have
// to avoid calling setTitle for frameless window.
if (!base::mac::IsAtLeastOS10_10() && (transparent() || !has_frame()))
return;
[window_ setTitle:base::SysUTF8ToNSString(title)];
}
std::string NativeWindowMac::GetTitle() {
return base::SysNSStringToUTF8([window_ title]);
;
}
void NativeWindowMac::FlashFrame(bool flash) {
@@ -1156,83 +1178,86 @@ bool NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
}
void NativeWindowMac::SetVibrancy(const std::string& type) {
NSView* vibrant_view = [window_ vibrantView];
if (@available(macOS 10.10, *)) {
NSView* vibrant_view = [window_ vibrantView];
if (type.empty()) {
if (background_color_before_vibrancy_) {
[window_ setBackgroundColor:background_color_before_vibrancy_];
[window_ setTitlebarAppearsTransparent:transparency_before_vibrancy_];
}
if (vibrant_view == nil)
return;
[vibrant_view removeFromSuperview];
[window_ setVibrantView:nil];
ui::GpuSwitchingManager::SetTransparent(transparent());
if (type.empty()) {
if (background_color_before_vibrancy_) {
[window_ setBackgroundColor:background_color_before_vibrancy_];
[window_ setTitlebarAppearsTransparent:transparency_before_vibrancy_];
}
if (vibrant_view == nil)
return;
[vibrant_view removeFromSuperview];
[window_ setVibrantView:nil];
ui::GpuSwitchingManager::SetTransparent(transparent());
return;
}
background_color_before_vibrancy_.reset([[window_ backgroundColor] retain]);
transparency_before_vibrancy_ = [window_ titlebarAppearsTransparent];
ui::GpuSwitchingManager::SetTransparent(true);
if (title_bar_style_ != NORMAL) {
[window_ setTitlebarAppearsTransparent:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
}
NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
if (effect_view == nil) {
effect_view = [[[NSVisualEffectView alloc]
initWithFrame:[[window_ contentView] bounds]] autorelease];
[window_ setVibrantView:(NSView*)effect_view];
[effect_view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[effect_view setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
[effect_view setState:NSVisualEffectStateActive];
[[window_ contentView] addSubview:effect_view
positioned:NSWindowBelow
relativeTo:nil];
}
NSVisualEffectMaterial vibrancyType = NSVisualEffectMaterialLight;
if (type == "appearance-based") {
vibrancyType = NSVisualEffectMaterialAppearanceBased;
} else if (type == "light") {
vibrancyType = NSVisualEffectMaterialLight;
} else if (type == "dark") {
vibrancyType = NSVisualEffectMaterialDark;
} else if (type == "titlebar") {
vibrancyType = NSVisualEffectMaterialTitlebar;
}
if (@available(macOS 10.11, *)) {
// TODO(kevinsawicki): Use NSVisualEffectMaterial* constants directly once
// they are available in the minimum SDK version
if (type == "selection") {
// NSVisualEffectMaterialSelection
vibrancyType = static_cast<NSVisualEffectMaterial>(4);
} else if (type == "menu") {
// NSVisualEffectMaterialMenu
vibrancyType = static_cast<NSVisualEffectMaterial>(5);
} else if (type == "popover") {
// NSVisualEffectMaterialPopover
vibrancyType = static_cast<NSVisualEffectMaterial>(6);
} else if (type == "sidebar") {
// NSVisualEffectMaterialSidebar
vibrancyType = static_cast<NSVisualEffectMaterial>(7);
} else if (type == "medium-light") {
// NSVisualEffectMaterialMediumLight
vibrancyType = static_cast<NSVisualEffectMaterial>(8);
} else if (type == "ultra-dark") {
// NSVisualEffectMaterialUltraDark
vibrancyType = static_cast<NSVisualEffectMaterial>(9);
}
}
[effect_view setMaterial:vibrancyType];
background_color_before_vibrancy_.reset([[window_ backgroundColor] retain]);
transparency_before_vibrancy_ = [window_ titlebarAppearsTransparent];
ui::GpuSwitchingManager::SetTransparent(true);
if (title_bar_style_ != NORMAL) {
[window_ setTitlebarAppearsTransparent:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
}
NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
if (effect_view == nil) {
effect_view = [[[NSVisualEffectView alloc]
initWithFrame:[[window_ contentView] bounds]] autorelease];
[window_ setVibrantView:(NSView*)effect_view];
[effect_view
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[effect_view setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
[effect_view setState:NSVisualEffectStateActive];
[[window_ contentView] addSubview:effect_view
positioned:NSWindowBelow
relativeTo:nil];
}
NSVisualEffectMaterial vibrancyType = NSVisualEffectMaterialLight;
if (type == "appearance-based") {
vibrancyType = NSVisualEffectMaterialAppearanceBased;
} else if (type == "light") {
vibrancyType = NSVisualEffectMaterialLight;
} else if (type == "dark") {
vibrancyType = NSVisualEffectMaterialDark;
} else if (type == "titlebar") {
vibrancyType = NSVisualEffectMaterialTitlebar;
}
if (@available(macOS 10.11, *)) {
// TODO(kevinsawicki): Use NSVisualEffectMaterial* constants directly once
// they are available in the minimum SDK version
if (type == "selection") {
// NSVisualEffectMaterialSelection
vibrancyType = static_cast<NSVisualEffectMaterial>(4);
} else if (type == "menu") {
// NSVisualEffectMaterialMenu
vibrancyType = static_cast<NSVisualEffectMaterial>(5);
} else if (type == "popover") {
// NSVisualEffectMaterialPopover
vibrancyType = static_cast<NSVisualEffectMaterial>(6);
} else if (type == "sidebar") {
// NSVisualEffectMaterialSidebar
vibrancyType = static_cast<NSVisualEffectMaterial>(7);
} else if (type == "medium-light") {
// NSVisualEffectMaterialMediumLight
vibrancyType = static_cast<NSVisualEffectMaterial>(8);
} else if (type == "ultra-dark") {
// NSVisualEffectMaterialUltraDark
vibrancyType = static_cast<NSVisualEffectMaterial>(9);
}
}
[effect_view setMaterial:vibrancyType];
}
}
void NativeWindowMac::SetTouchBar(
@@ -1316,6 +1341,11 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent,
[parent->GetNativeWindow() addChildWindow:window_ ordered:NSWindowAbove];
}
void NativeWindowMac::ShowWindowButton(NSWindowButton button) {
auto view = [window_ standardWindowButton:button];
[view.superview addSubview:view positioned:NSWindowAbove relativeTo:nil];
}
void NativeWindowMac::SetForwardMouseMessages(bool forward) {
[window_ setAcceptsMouseMovedEvents:forward];
}

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key>
<string>electron.icns</string>
<key>CFBundleVersion</key>
<string>0.0.0</string>
<string>3.0.0</string>
<key>CFBundleShortVersionString</key>
<string>0.0.0</string>
<string>3.0.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>

View File

@@ -56,8 +56,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEVERSION 3,0,0,1
PRODUCTVERSION 3,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -74,12 +74,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "0.0.0"
VALUE "FileVersion", "3.0.0"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "0.0.0"
VALUE "ProductVersion", "3.0.0"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -29,16 +29,19 @@ class ScopedDisableResize {
@interface AtomNSWindow : NativeWidgetMacNSWindow {
@private
atom::NativeWindowMac* shell_;
CGFloat windowButtonsInterButtonSpacing_;
}
@property BOOL acceptsFirstMouse;
@property BOOL enableLargerThanScreen;
@property BOOL disableAutoHideCursor;
@property BOOL disableKeyOrMainWindow;
@property NSPoint windowButtonsOffset;
@property(nonatomic, retain) NSView* vibrantView;
- (id)initWithShell:(atom::NativeWindowMac*)shell
styleMask:(NSUInteger)styleMask;
- (atom::NativeWindowMac*)shell;
- (NSRect)originalContentRectForFrameRect:(NSRect)frameRect;
- (void)enableWindowButtonsOffset;
- (void)toggleFullScreenMode:(id)sender;
@end

View File

@@ -21,6 +21,7 @@ bool ScopedDisableResize::disable_resize_ = false;
@synthesize enableLargerThanScreen;
@synthesize disableAutoHideCursor;
@synthesize disableKeyOrMainWindow;
@synthesize windowButtonsOffset;
@synthesize vibrantView;
- (id)initWithShell:(atom::NativeWindowMac*)shell
@@ -116,6 +117,78 @@ bool ScopedDisableResize::disable_resize_ = false;
return !self.disableKeyOrMainWindow;
}
- (void)enableWindowButtonsOffset {
auto closeButton = [self standardWindowButton:NSWindowCloseButton];
auto miniaturizeButton =
[self standardWindowButton:NSWindowMiniaturizeButton];
auto zoomButton = [self standardWindowButton:NSWindowZoomButton];
[closeButton setPostsFrameChangedNotifications:YES];
[miniaturizeButton setPostsFrameChangedNotifications:YES];
[zoomButton setPostsFrameChangedNotifications:YES];
windowButtonsInterButtonSpacing_ =
NSMinX([miniaturizeButton frame]) - NSMaxX([closeButton frame]);
auto center = [NSNotificationCenter defaultCenter];
[center addObserver:self
selector:@selector(adjustCloseButton:)
name:NSViewFrameDidChangeNotification
object:closeButton];
[center addObserver:self
selector:@selector(adjustMiniaturizeButton:)
name:NSViewFrameDidChangeNotification
object:miniaturizeButton];
[center addObserver:self
selector:@selector(adjustZoomButton:)
name:NSViewFrameDidChangeNotification
object:zoomButton];
}
- (void)adjustCloseButton:(NSNotification*)notification {
[self adjustButton:[notification object] ofKind:NSWindowCloseButton];
}
- (void)adjustMiniaturizeButton:(NSNotification*)notification {
[self adjustButton:[notification object] ofKind:NSWindowMiniaturizeButton];
}
- (void)adjustZoomButton:(NSNotification*)notification {
[self adjustButton:[notification object] ofKind:NSWindowZoomButton];
}
- (void)adjustButton:(NSButton*)button ofKind:(NSWindowButton)kind {
NSRect buttonFrame = [button frame];
NSRect frameViewBounds = [[self frameView] bounds];
NSPoint offset = self.windowButtonsOffset;
buttonFrame.origin = NSMakePoint(
offset.x, (NSHeight(frameViewBounds) - NSHeight(buttonFrame) - offset.y));
switch (kind) {
case NSWindowZoomButton:
buttonFrame.origin.x += NSWidth(
[[self standardWindowButton:NSWindowMiniaturizeButton] frame]);
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
// fallthrough
case NSWindowMiniaturizeButton:
buttonFrame.origin.x +=
NSWidth([[self standardWindowButton:NSWindowCloseButton] frame]);
buttonFrame.origin.x += windowButtonsInterButtonSpacing_;
// fallthrough
default:
break;
}
BOOL didPost = [button postsBoundsChangedNotifications];
[button setPostsFrameChangedNotifications:NO];
[button setFrame:buttonFrame];
[button setPostsFrameChangedNotifications:didPost];
}
- (NSView*)frameView {
return [[self contentView] superview];
}

View File

@@ -168,54 +168,60 @@
shell_->SetResizable(true);
// Hide the native toolbar before entering fullscreen, so there is no visual
// artifacts.
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
NSWindow* window = shell_->GetNativeWindow();
[window setToolbar:nil];
if (@available(macOS 10.10, *)) {
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
NSWindow* window = shell_->GetNativeWindow();
[window setToolbar:nil];
}
}
}
- (void)windowDidEnterFullScreen:(NSNotification*)notification {
shell_->NotifyWindowEnterFullScreen();
// For frameless window we don't show set title for normal mode since the
// titlebar is expected to be empty, but after entering fullscreen mode we
// have to set one, because title bar is visible here.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
// fullscreen mode.
// Show title if fullscreen_window_title flag is set
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleVisible];
}
if (@available(macOS 10.10, *)) {
// For frameless window we don't show set title for normal mode since the
// titlebar is expected to be empty, but after entering fullscreen mode we
// have to set one, because title bar is visible here.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
// fullscreen mode.
// Show title if fullscreen_window_title flag is set
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleVisible];
}
// Restore the native toolbar immediately after entering fullscreen, if we
// do this before leaving fullscreen, traffic light buttons will be jumping.
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
[toolbar setShowsBaselineSeparator:NO];
[window setToolbar:toolbar];
// Restore the native toolbar immediately after entering fullscreen, if we
// do this before leaving fullscreen, traffic light buttons will be jumping.
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
[toolbar setShowsBaselineSeparator:NO];
[window setToolbar:toolbar];
// Set window style to hide the toolbar, otherwise the toolbar will show
// in fullscreen mode.
shell_->SetStyleMask(true, NSFullSizeContentViewWindowMask);
// Set window style to hide the toolbar, otherwise the toolbar will show
// in fullscreen mode.
shell_->SetStyleMask(true, NSFullSizeContentViewWindowMask);
}
}
}
- (void)windowWillExitFullScreen:(NSNotification*)notification {
// Restore the titlebar visibility.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleHidden];
}
if (@available(macOS 10.10, *)) {
// Restore the titlebar visibility.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleHidden];
}
// Turn off the style for toolbar.
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
shell_->SetStyleMask(false, NSFullSizeContentViewWindowMask);
// Turn off the style for toolbar.
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
shell_->SetStyleMask(false, NSFullSizeContentViewWindowMask);
}
}
}

View File

@@ -5,10 +5,10 @@
#ifndef ATOM_COMMON_ATOM_VERSION_H_
#define ATOM_COMMON_ATOM_VERSION_H_
#define ATOM_MAJOR_VERSION 0
#define ATOM_MAJOR_VERSION 3
#define ATOM_MINOR_VERSION 0
#define ATOM_PATCH_VERSION 0
#define ATOM_PRE_RELEASE_VERSION -dev
#define ATOM_PRE_RELEASE_VERSION -beta.1
#ifndef ATOM_STRINGIFY
#define ATOM_STRINGIFY(n) ATOM_STRINGIFY_HELPER(n)

View File

@@ -29,7 +29,8 @@ class CocoaNotification : public Notification {
void NotificationDisplayed();
void NotificationReplied(const std::string& reply);
void NotificationActivated();
void NotificationActivated(NSUserNotificationAction* action);
void NotificationActivated(NSUserNotificationAction* action)
API_AVAILABLE(macosx(10.10));
NSUserNotification* notification() const { return notification_; }

View File

@@ -72,18 +72,24 @@ void CocoaNotification::Show(const NotificationOptions& options) {
// All of the rest are appended to the list of additional actions
NSString* actionIdentifier =
[NSString stringWithFormat:@"%@Action%d", identifier, i];
NSUserNotificationAction* notificationAction = [NSUserNotificationAction
actionWithIdentifier:actionIdentifier
title:base::SysUTF16ToNSString(action.text)];
[additionalActions addObject:notificationAction];
additional_action_indices_.insert(
std::make_pair(base::SysNSStringToUTF8(actionIdentifier), i));
if (@available(macOS 10.10, *)) {
NSUserNotificationAction* notificationAction =
[NSUserNotificationAction
actionWithIdentifier:actionIdentifier
title:base::SysUTF16ToNSString(action.text)];
[additionalActions addObject:notificationAction];
additional_action_indices_.insert(
std::make_pair(base::SysNSStringToUTF8(actionIdentifier), i));
}
}
}
i++;
}
if ([additionalActions count] > 0) {
[notification_ setAdditionalActions:additionalActions];
if ([additionalActions count] > 0 &&
[notification_ respondsToSelector:@selector(setAdditionalActions:)]) {
if (@available(macOS 10.10, *)) {
[notification_ setAdditionalActions:additionalActions];
}
}
if (options.has_reply) {

View File

@@ -48,9 +48,12 @@
NSUserNotificationActivationTypeReplied) {
notification->NotificationReplied([notif.response.string UTF8String]);
} else {
if (notif.activationType ==
NSUserNotificationActivationTypeAdditionalActionClicked) {
notification->NotificationActivated([notif additionalActivationAction]);
if (@available(macOS 10.10, *)) {
if (notif.activationType ==
NSUserNotificationActivationTypeAdditionalActionClicked) {
notification->NotificationActivated(
[notif additionalActivationAction]);
}
}
}
}

View File

@@ -155,6 +155,7 @@
'BUILDING_V8_SHARED',
'BUILDING_V8_PLATFORM_SHARED',
'BUILDING_V8_BASE_SHARED',
'NODE_WITHOUT_NODE_OPTIONS',
],
'conditions': [
['OS=="mac" and libchromiumcontent_component==0', {

View File

@@ -21,10 +21,11 @@ win.show()
### Alternatives on macOS
There's an alternative way to specify a chromeless window.
Instead of setting `frame` to `false` which disables both the titlebar and window controls,
you may want to have the title bar hidden and your content extend to the full window size,
yet still preserve the window controls ("traffic lights") for standard window actions.
On macOS 10.9 Mavericks and newer, there's an alternative way to specify
a chromeless window. Instead of setting `frame` to `false` which disables
both the titlebar and window controls, you may want to have the title bar
hidden and your content extend to the full window size, yet still preserve
the window controls ("traffic lights") for standard window actions.
You can do so by specifying the `titleBarStyle` option:
#### `hidden`

View File

@@ -7,7 +7,7 @@ rudimentary understanding of your operating system's command line client.
## Setting up macOS
> Electron supports OS X Yosemite (version 10.10) and up. Apple
> Electron supports Mac OS X 10.9 (and all versions named macOS) and up. Apple
does not allow running macOS in virtual machines unless the host computer is
already an Apple computer, so if you find yourself in need of a Mac, consider
using a cloud service that rents access to Macs (like [MacInCloud][macincloud]

View File

@@ -61,7 +61,7 @@ Following platforms are supported by Electron:
### macOS
Only 64bit binaries are provided for macOS, and the minimum macOS version
supported is OS X Yosemite (version 10.10).
supported is macOS 10.9.
### Windows
@@ -79,7 +79,7 @@ Ubuntu 12.04, the `armv7l` binary is built against ARM v7 with hard-float ABI an
NEON for Debian Wheezy.
[Until the release of Electron 2.0][arm-breaking-change], Electron will also
continue to release the `armv7l` binary with a simple `arm` suffix. Both binaries
continue to release the `armv7l` binary with a simple `arm` suffix. Both binaries
are identical.
Whether the prebuilt binary can run on a distribution depends on whether the

View File

@@ -4,7 +4,7 @@
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%': '0.0.0-dev',
'version%': '3.0.0-beta.1',
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
},
'includes': [
@@ -399,6 +399,13 @@
'atom/common/crash_reporter/crash_reporter_mac.h',
'atom/common/crash_reporter/crash_reporter_mac.mm',
],
'dependencies': [
# Somehow we have code from Chromium using crashpad, very likely
# from components/crash.
# Since we do not actually invoke code from components/crash, this
# dependency should be eventually optimized out by linker.
'vendor/crashpad/client/client.gyp:crashpad_client',
],
}], # OS=="mac" and mas_build==1
['OS=="linux"', {
'sources': [

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "0.0.0-dev",
"version": "3.0.0-beta.1",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -192,7 +192,7 @@ def update_package_json(version, suffix):
def tag_version(version, suffix):
execute(['git', 'commit', '-a', '-m', 'Bump v{0}'.format(version + suffix)])
execute(['git', 'commit', '-a', '--no-verify', '-m', 'Bump v{0}'.format(version + suffix)])
if __name__ == '__main__':

View File

@@ -75,7 +75,7 @@ async function getReleaseNotes (currentBranch) {
let githubOpts = {
owner: 'electron',
repo: 'electron',
base: `v${pkg.version}`,
base: `2a97e48465a3af9e5448a8d06c1d65d16c516e8f`,
head: currentBranch
}
let releaseNotes

21
script/tls.cert.pem Normal file
View File

@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDZDCCAkwCCQDw+ZvdiZ6UJTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJB
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEdMBsGA1UECgwURE8gTk9UIFVTRSBUSElT
IENFUlQxHTAbBgNVBAsMFFRISVMgQ0VSVCBJUyBVU0VMRVNTMRIwEAYDVQQDDAlk
ZWFkLmNlcnQwHhcNMTgwNjIwMDY0OTE2WhcNMTkwNjIwMDY0OTE2WjB0MQswCQYD
VQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEdMBsGA1UECgwURE8gTk9UIFVT
RSBUSElTIENFUlQxHTAbBgNVBAsMFFRISVMgQ0VSVCBJUyBVU0VMRVNTMRIwEAYD
VQQDDAlkZWFkLmNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9
0UnRjuXgIO1no5xFCugzcje1GlDd88AJCJyxySOJZhpry1S9mtrM0iQvGb+v9ixq
mLuMBEsG1mvjECD6mFREHHK2NHFuSnfKtZkkzb3/turSEvmiRCXD+X0N+knuXjjl
P6eo+hiGhhkDYHxz19e66ecVAYQThkQinZDU0l0rMbEMB9fKwcgiC9vG6tE7fE4i
z3WLhT+LBS02qkJGLGIyCnOsJMMBoXpAV0DwB2CA05vTP8SrrllMg2Q4YAFhxAZl
f/YHeJsvVyhbbw/k+oPypgdKRjYSCwSFgllOADVBv5gJ6lWt3to7B/HpFh9pTNuA
12go7AJ2tBrIBj485P7HAgMBAAEwDQYJKoZIhvcNAQELBQADggEBALWyR7u+Tcde
U1kwitc6cJYwE2uZZS8+f5L3WLouoAw4Jr0GlqO9uZC8lwMbvO5tRN1khV8HdZ8k
c/qoY/fwzW0qNjDDfz9tev73iu8SlL4iu9g9CDlISIFZlqmBr+g3Szw/l2ghud3a
bogwgsZjWlODWFsJJE9gBKSzh2oiDDYa4PWkrkTg8VUe/8BLUc2ijKc6KXPPR72V
iDXqKmM3S+Pa6a/evJo1z0KxsbSqs/ErIzY7JxSPG6Gw7NMYD6QmoJhNePicarIA
LRFZqTFfi8v7Dmj58WI9BN1dkGtzTpYM4RL4gjmQmTf7J+mpgPDH9pi1pB1NZwxN
pJmyETQUqDA=
-----END CERTIFICATE-----

18
script/tls.js Normal file
View File

@@ -0,0 +1,18 @@
var fs = require('fs')
var https = require('https')
var path = require('path')
var server = https.createServer({
key: fs.readFileSync(path.resolve(__dirname, 'tls.key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'tls.cert.pem'))
}, (req, res) => {
res.end(JSON.stringify({ protocol: req.socket.getProtocol() }))
setTimeout(() => {
server.close()
}, 0)
})
server.listen(0, () => {
console.log(server.address().port)
})

27
script/tls.key.pem Normal file
View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAvdFJ0Y7l4CDtZ6OcRQroM3I3tRpQ3fPACQicsckjiWYaa8tU
vZrazNIkLxm/r/Ysapi7jARLBtZr4xAg+phURBxytjRxbkp3yrWZJM29/7bq0hL5
okQlw/l9DfpJ7l445T+nqPoYhoYZA2B8c9fXuunnFQGEE4ZEIp2Q1NJdKzGxDAfX
ysHIIgvbxurRO3xOIs91i4U/iwUtNqpCRixiMgpzrCTDAaF6QFdA8AdggNOb0z/E
q65ZTINkOGABYcQGZX/2B3ibL1coW28P5PqD8qYHSkY2EgsEhYJZTgA1Qb+YCepV
rd7aOwfx6RYfaUzbgNdoKOwCdrQayAY+POT+xwIDAQABAoIBAEDIT/hMW9odgsjP
RwMtUMhWH/sYKydFDHJI1Sm8Kvu2tCe78oTvd+NViPHmSMymKMyMqd2EjZKc1Z9e
HtNH7+J7Dw9uYJQyqCWvyr+L1F+UrxnZTgd6WKVE3dBKbrcCw0pCalc6W+p1k83a
PT9QGBl7wNkjdk8vkMt7mTV5QkD+El20bsxhgVptS/SOgcRZha5HHC074b/WU0lr
gXm+9Bmh3ND/FRF8rE2FEd8JjmEOioidpv/RaQyuj3Zc3Wf4cex7JLkhlpWaxriz
5WxnIURtRDYruP1kjvACQGYnpBsBPA86vsRk03/vKpjmcklYDNbzc2uU7IWRmMsh
VXILl7kCgYEA9BQogsCOyxiHwIcG7d7n8eG8UrBeFVTCOKabQCVX4jr2d6JbFGCX
7BHTaSoN7QU1fmBJXp8+LckQ2TLKYKfGVzgyKjymJYgm4DE4r39jaHln+llHLOOW
RiC+IC2npCYEsE+8A4wlOqi02srSVIriOT8tbZSSxnC8C+tkBANc4pUCgYEAxxas
onV5RyK7/XhhKofueEw8h3IvrjQzVLUQZ+XtTcsJVcuAwEhoJ4Ckpwaou69i4M8y
+OZJLUlU/UJykrgdmGmwcSE+Ncv7RjyQVhHThSSV+n9vdmdm+Jk93Eya4PG7oCF6
a+qtXdH/1IQ4YRTBbxKQDPjQCXC4G7fbqlzdAOsCgYEAmtsfSLW64whROMlykADY
0BIUVbIoPwhjoWWzImOO+q3GKekMOEWAnfpBU3unEjY31lJoumv2Gz5yPhuHYwOP
R08UJNAN6coUQDF6cX41J9e/LIrwKX7LnPqxJeFRd0fXubUc6HNGO41GEXqVL6Ze
GUwIGnolFVn5NObHsfQgPnECgYBAf6gOOeDAmxAsXgOcs80eTBSQDP5FgcPffYmD
H4px2YV8tiFQKiUUJykws4eWxotSKc5ptLGgalGOeyiDQALWjecLv6lX5G3To2tf
dwb/64prTT3fLkC96WeRJ4BFwAr5Jd9zduQTsSUgxHU/fmnsgicJDNLZPBtpX3db
ChrPYQKBgCbZCntXj6MkGZSNZ5IlNynl2XmPa9kN+ztCrTPPP3imAZgcDmROUjj+
0eZiCjX/GJTO5uLSFtZxl3YnpWZsJJZSwnwPwEEo3+t5ves2dG+oJbeWLbj7xxE5
LX934fWHWUof/qDY38/2Mu6+uu7IpNZlfAJ/hsjDE9pw8f0D6Xa+
-----END RSA PRIVATE KEY-----

View File

@@ -1,12 +1,31 @@
#!/usr/bin/env python
import json
import urllib2
import os
import ssl
import subprocess
import sys
import urllib2
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
def check_tls(verbose):
response = json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))
tls = response['tls_version']
process = subprocess.Popen(
'node tls.js',
cwd=os.path.dirname(os.path.realpath(__file__)),
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
port = process.stdout.readline()
localhost_url = 'https://localhost:' + port
response = json.load(urllib2.urlopen(localhost_url, context=ctx))
tls = response['protocol']
process.wait()
if sys.platform == "linux" or sys.platform == "linux2":
tutorial = "./docs/development/build-instructions-linux.md"
@@ -18,7 +37,7 @@ def check_tls(verbose):
tutorial = "build instructions for your operating system" \
+ "in ./docs/development/"
if tls == "TLS 1.0":
if tls == "TLSv1" or tls == "TLSv1.1":
print "Your system/python combination is using an outdated security" \
+ "protocol and will not be able to compile Electron. Please see " \
+ tutorial + "." \

View File

@@ -955,8 +955,8 @@ describe('chromium feature', () => {
const port = server.address().port
wss = new WebSocketServer({ server: server })
wss.on('error', done)
wss.on('connection', (ws) => {
if (ws.upgradeReq.headers['user-agent']) {
wss.on('connection', (ws, upgradeReq) => {
if (upgradeReq.headers['user-agent']) {
done()
} else {
done('user agent is empty')

835
spec/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,25 +4,25 @@
"main": "static/main.js",
"version": "0.1.0",
"devDependencies": {
"basic-auth": "^1.0.4",
"basic-auth": "^2.0.0",
"bluebird": "^3.5.1",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"coffee-script": "1.12.7",
"dbus-native": "^0.2.3",
"dbus-native": "^0.2.5",
"dirty-chai": "^2.0.1",
"graceful-fs": "^4.1.9",
"graceful-fs": "^4.1.11",
"mkdirp": "^0.5.1",
"mocha": "^3.1.0",
"mocha-junit-reporter": "^1.14.0",
"multiparty": "^4.1.3",
"q": "^1.4.1",
"mocha": "^5.2.0",
"mocha-junit-reporter": "^1.17.0",
"multiparty": "^4.1.4",
"q": "^1.5.1",
"send": "^0.16.2",
"temp": "^0.8.3",
"walkdir": "0.0.11",
"walkdir": "0.0.12",
"winreg": "^1.2.4",
"ws": "^1.1.1",
"yargs": "^6.0.0"
"ws": "^5.2.0",
"yargs": "^11.0.0"
},
"optionalDependencies": {
"runas": "3.x"