diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 946b2a41cdd..12a147ebc2b 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -54,10 +54,8 @@ static const CGFloat kAtomWindowCornerRadius = 4.0; @interface AtomNSWindowDelegate : NSObject { @private atom::NativeWindowMac* shell_; - BOOL acceptsFirstMouse_; } - (id)initWithShell:(atom::NativeWindowMac*)shell; -- (void)setAcceptsFirstMouse:(BOOL)accept; @end @implementation AtomNSWindowDelegate @@ -65,15 +63,10 @@ static const CGFloat kAtomWindowCornerRadius = 4.0; - (id)initWithShell:(atom::NativeWindowMac*)shell { if ((self = [super init])) { shell_ = shell; - acceptsFirstMouse_ = NO; } return self; } -- (void)setAcceptsFirstMouse:(BOOL)accept { - acceptsFirstMouse_ = accept; -} - - (void)windowDidBecomeMain:(NSNotification*)notification { content::WebContents* web_contents = shell_->GetWebContents(); if (!web_contents) @@ -151,10 +144,6 @@ static const CGFloat kAtomWindowCornerRadius = 4.0; return NO; } -- (BOOL)acceptsFirstMouse:(NSEvent*)event { - return acceptsFirstMouse_; -} - @end @interface AtomNSWindow : EventProcessingWindow { @@ -162,6 +151,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0; atom::NativeWindowMac* shell_; bool enable_larger_than_screen_; } +@property BOOL acceptsFirstMouse; - (void)setShell:(atom::NativeWindowMac*)shell; - (void)setEnableLargerThanScreen:(bool)enable; @end @@ -355,7 +345,7 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents, // Enable the NSView to accept first mouse event. bool acceptsFirstMouse = false; options.Get(switches::kAcceptFirstMouse, &acceptsFirstMouse); - [window_delegate_ setAcceptsFirstMouse:acceptsFirstMouse]; + [window_ setAcceptsFirstMouse:acceptsFirstMouse]; // Disable fullscreen button when 'fullscreen' is specified to false. bool fullscreen;