From: Cheng Zhao Date: Thu, 12 Sep 2013 07:13:56 +0000 (+0800) Subject: Remove code which are used for borderless window. X-Git-Tag: v0.4.7~1^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7a1365673e508fd8e83654b7b11388a0d7cb61eb;p=electron.git Remove code which are used for borderless window. --- diff --git a/browser/native_window_mac.mm b/browser/native_window_mac.mm index d3d8087e..7c64f87d 100644 --- a/browser/native_window_mac.mm +++ b/browser/native_window_mac.mm @@ -24,9 +24,7 @@ #include "content/public/browser/web_contents_view.h" #include "content/public/browser/render_view_host.h" -@interface NSWindow (NSPrivateApis) -- (void)setBottomCornerRounded:(BOOL)rounded; -@end +static const CGFloat kAtomWindowCornerRadius = 4.0; @interface NSView (PrivateMethods) - (CGFloat)roundedCornerRadius; @@ -78,8 +76,6 @@ @end -static CGFloat const AtomWindowCornerRadius = 4.0; - @interface AtomNSWindow : AtomEventProcessingWindow { @protected atom::NativeWindowMac* shell_; @@ -116,26 +112,6 @@ static CGFloat const AtomWindowCornerRadius = 4.0; NSRectFill(rect); } -- (BOOL)canBecomeKeyWindow { - return YES; -} - -- (BOOL)canBecomeMainWindow { - return YES; -} - -- (BOOL)hasShadow { - return YES; -} - -- (void)keyDown:(NSEvent*)event { - [self redispatchKeyEvent:event]; -} - -- (void)keyUp:(NSEvent *)event { - [self redispatchKeyEvent:event]; -} - @end @interface ControlRegionView : NSView { @@ -204,8 +180,7 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents, } else { atomWindow = [[AtomFramelessNSWindow alloc] initWithContentRect:cocoa_bounds - styleMask:NSTitledWindowMask | NSClosableWindowMask | - NSMiniaturizableWindowMask | NSResizableWindowMask + styleMask:style_mask backing:NSBackingStoreBuffered defer:YES]; [atomWindow setOpaque:NO]; @@ -491,11 +466,9 @@ void NativeWindowMac::InstallView() { [[window() contentView] addSubview:view]; } else { NSView* frameView = [[window() contentView] superview]; - [view setFrame:[frameView bounds]]; [frameView addSubview:view]; - ClipWebView(); [[window() standardWindowButton:NSWindowZoomButton] setHidden:YES]; @@ -513,12 +486,9 @@ void NativeWindowMac::UninstallView() { void NativeWindowMac::ClipWebView() { NSView* view = GetWebContents()->GetView()->GetNativeView(); - // if ([view respondsToSelector:@selector(roundedCornerRadius)]) - // cornerRadius = [view roundedCornerRadius]; - view.wantsLayer = YES; view.layer.masksToBounds = YES; - view.layer.cornerRadius = AtomWindowCornerRadius; + view.layer.cornerRadius = kAtomWindowCornerRadius; } void NativeWindowMac::InstallDraggableRegionViews() {