| Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| index 82cb3378718185d15da4ecfd21ee199dfeace9f3..a51806361a3e558bbf08a6e662eaf341a7e7ffbe 100644
|
| --- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| @@ -86,18 +86,18 @@
|
|
|
| @end
|
|
|
| -@interface ShellNSWindow : ChromeEventProcessingWindow
|
| -
|
| -- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
|
| -
|
| -@end
|
| -
|
| // This is really a method on NSGrayFrame, so it should only be called on the
|
| // view passed into -[NSWindow drawCustomFrameRect:forView:].
|
| @interface NSView (PrivateMethods)
|
| - (CGFloat)roundedCornerRadius;
|
| @end
|
|
|
| +@interface ShellNSWindow : ChromeEventProcessingWindow
|
| +
|
| +- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
|
| +
|
| +@end
|
| +
|
| @implementation ShellNSWindow
|
|
|
| - (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
|
| @@ -116,6 +116,14 @@
|
| NSRectFill(rect);
|
| }
|
|
|
| +@end
|
| +
|
| +@interface ShellFramelessNSWindow : ShellNSWindow
|
| +
|
| +@end
|
| +
|
| +@implementation ShellFramelessNSWindow
|
| +
|
| + (NSRect)frameRectForContentRect:(NSRect)contentRect
|
| styleMask:(NSUInteger)mask {
|
| return contentRect;
|
| @@ -175,11 +183,20 @@ ShellWindowCocoa::ShellWindowCocoa(ShellWindow* shell_window,
|
| NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
|
| NSMiniaturizableWindowMask | NSResizableWindowMask |
|
| NSTexturedBackgroundWindowMask;
|
| - scoped_nsobject<NSWindow> window([[ShellNSWindow alloc]
|
| - initWithContentRect:cocoa_bounds
|
| - styleMask:style_mask
|
| - backing:NSBackingStoreBuffered
|
| - defer:NO]);
|
| + scoped_nsobject<NSWindow> window;
|
| + if (has_frame_) {
|
| + window.reset([[ShellNSWindow alloc]
|
| + initWithContentRect:cocoa_bounds
|
| + styleMask:style_mask
|
| + backing:NSBackingStoreBuffered
|
| + defer:NO]);
|
| + } else {
|
| + window.reset([[ShellFramelessNSWindow alloc]
|
| + initWithContentRect:cocoa_bounds
|
| + styleMask:style_mask
|
| + backing:NSBackingStoreBuffered
|
| + defer:NO]);
|
| + }
|
| [window setTitle:base::SysUTF8ToNSString(extension()->name())];
|
| gfx::Size min_size = params.minimum_size;
|
| if (min_size.width() || min_size.height()) {
|
|
|