Remove code which are used for borderless window.
This commit is contained in:
parent
6c098deb57
commit
7a1365673e
1 changed files with 3 additions and 33 deletions
|
@ -24,9 +24,7 @@
|
||||||
#include "content/public/browser/web_contents_view.h"
|
#include "content/public/browser/web_contents_view.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
|
|
||||||
@interface NSWindow (NSPrivateApis)
|
static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
- (void)setBottomCornerRounded:(BOOL)rounded;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface NSView (PrivateMethods)
|
@interface NSView (PrivateMethods)
|
||||||
- (CGFloat)roundedCornerRadius;
|
- (CGFloat)roundedCornerRadius;
|
||||||
|
@ -78,8 +76,6 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static CGFloat const AtomWindowCornerRadius = 4.0;
|
|
||||||
|
|
||||||
@interface AtomNSWindow : AtomEventProcessingWindow {
|
@interface AtomNSWindow : AtomEventProcessingWindow {
|
||||||
@protected
|
@protected
|
||||||
atom::NativeWindowMac* shell_;
|
atom::NativeWindowMac* shell_;
|
||||||
|
@ -116,26 +112,6 @@ static CGFloat const AtomWindowCornerRadius = 4.0;
|
||||||
NSRectFill(rect);
|
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
|
@end
|
||||||
|
|
||||||
@interface ControlRegionView : NSView {
|
@interface ControlRegionView : NSView {
|
||||||
|
@ -204,8 +180,7 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
|
||||||
} else {
|
} else {
|
||||||
atomWindow = [[AtomFramelessNSWindow alloc]
|
atomWindow = [[AtomFramelessNSWindow alloc]
|
||||||
initWithContentRect:cocoa_bounds
|
initWithContentRect:cocoa_bounds
|
||||||
styleMask:NSTitledWindowMask | NSClosableWindowMask |
|
styleMask:style_mask
|
||||||
NSMiniaturizableWindowMask | NSResizableWindowMask
|
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:YES];
|
defer:YES];
|
||||||
[atomWindow setOpaque:NO];
|
[atomWindow setOpaque:NO];
|
||||||
|
@ -491,11 +466,9 @@ void NativeWindowMac::InstallView() {
|
||||||
[[window() contentView] addSubview:view];
|
[[window() contentView] addSubview:view];
|
||||||
} else {
|
} else {
|
||||||
NSView* frameView = [[window() contentView] superview];
|
NSView* frameView = [[window() contentView] superview];
|
||||||
|
|
||||||
[view setFrame:[frameView bounds]];
|
[view setFrame:[frameView bounds]];
|
||||||
[frameView addSubview:view];
|
[frameView addSubview:view];
|
||||||
|
|
||||||
|
|
||||||
ClipWebView();
|
ClipWebView();
|
||||||
|
|
||||||
[[window() standardWindowButton:NSWindowZoomButton] setHidden:YES];
|
[[window() standardWindowButton:NSWindowZoomButton] setHidden:YES];
|
||||||
|
@ -513,12 +486,9 @@ void NativeWindowMac::UninstallView() {
|
||||||
void NativeWindowMac::ClipWebView() {
|
void NativeWindowMac::ClipWebView() {
|
||||||
NSView* view = GetWebContents()->GetView()->GetNativeView();
|
NSView* view = GetWebContents()->GetView()->GetNativeView();
|
||||||
|
|
||||||
// if ([view respondsToSelector:@selector(roundedCornerRadius)])
|
|
||||||
// cornerRadius = [view roundedCornerRadius];
|
|
||||||
|
|
||||||
view.wantsLayer = YES;
|
view.wantsLayer = YES;
|
||||||
view.layer.masksToBounds = YES;
|
view.layer.masksToBounds = YES;
|
||||||
view.layer.cornerRadius = AtomWindowCornerRadius;
|
view.layer.cornerRadius = kAtomWindowCornerRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::InstallDraggableRegionViews() {
|
void NativeWindowMac::InstallDraggableRegionViews() {
|
||||||
|
|
Loading…
Reference in a new issue