Chromium Code Reviews| 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 88b5c4fe3c896e524d508c0e4d53d8922565e3b1..afea8ed8979528b90ef4875d180f0d5dc249e63f 100644 |
| --- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm |
| @@ -79,18 +79,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 { |
| @@ -109,6 +109,14 @@ |
| NSRectFill(rect); |
| } |
| +@end |
| + |
| +@interface ShellFramelessNSWindow : ShellNSWindow |
| + |
| +@end |
| + |
| +@implementation ShellFramelessNSWindow |
| + |
| + (NSRect)frameRectForContentRect:(NSRect)contentRect |
| styleMask:(NSUInteger)mask { |
| return contentRect; |
| @@ -168,7 +176,15 @@ ShellWindowCocoa::ShellWindowCocoa(ShellWindow* shell_window, |
| NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask | |
| NSMiniaturizableWindowMask | NSResizableWindowMask | |
| NSTexturedBackgroundWindowMask; |
| - scoped_nsobject<NSWindow> window([[ShellNSWindow alloc] |
| + scoped_nsobject<NSWindow> window; |
| + if (has_frame_) |
|
Robert Sesek
2012/09/17 18:50:45
Multi-line bodies need {} braces.
|
| + window.reset([[ShellNSWindow alloc] |
| + initWithContentRect:cocoa_bounds |
|
Robert Sesek
2012/09/17 18:50:45
nit: continuations need to be indented 4 spaces fr
|
| + styleMask:style_mask |
| + backing:NSBackingStoreBuffered |
| + defer:NO]); |
| + else |
| + window.reset([[ShellFramelessNSWindow alloc] |
| initWithContentRect:cocoa_bounds |
| styleMask:style_mask |
| backing:NSBackingStoreBuffered |