]> khamidou — GitHub mirrors - electron.git/commitdiff
Remove code which are used for borderless window.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 12 Sep 2013 07:13:56 +0000 (15:13 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 12 Sep 2013 07:13:56 +0000 (15:13 +0800)
browser/native_window_mac.mm

index d3d8087e366b107cdc3fd85b165b52b5441ab5e7..7c64f87d90f60aa71725a4768d499364d54c962f 100644 (file)
@@ -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() {