| 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 479114c31a81bbb470f150af05ffa3fdd2f05708..a1455180ac7fb41e34253a37d525e2033906174e 100644
|
| --- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
|
| @@ -72,6 +72,17 @@
|
|
|
| @end
|
|
|
| +@interface ControlRegionView : NSView
|
| +@end
|
| +@implementation ControlRegionView
|
| +- (BOOL)mouseDownCanMoveWindow {
|
| + return NO;
|
| +}
|
| +- (NSView*)hitTest:(NSPoint)aPoint {
|
| + return nil;
|
| +}
|
| +@end
|
| +
|
| ShellWindowCocoa::ShellWindowCocoa(Profile* profile,
|
| const extensions::Extension* extension,
|
| const GURL& url,
|
| @@ -108,9 +119,29 @@ ShellWindowCocoa::ShellWindowCocoa(Profile* profile,
|
| [window setBottomCornerRounded:NO];
|
|
|
| NSView* view = web_contents()->GetView()->GetNativeView();
|
| - [view setFrame:[[window contentView] bounds]];
|
| [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
| - [[window contentView] addSubview:view];
|
| + if (params.frame == ShellWindow::CreateParams::FRAME_CHROME) {
|
| + [view setFrame:[[window contentView] bounds]];
|
| + [[window contentView] addSubview:view];
|
| + } else {
|
| + web_contents()->GetView()->SetMouseDownCanMoveWindow(true);
|
| + NSView* frameView = [[window contentView] superview];
|
| + [view setFrame:[frameView bounds]];
|
| + [frameView addSubview:view];
|
| + [[window standardWindowButton:NSWindowZoomButton] setHidden:YES];
|
| + [[window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
|
| + [[window standardWindowButton:NSWindowCloseButton] setHidden:YES];
|
| +
|
| + // TODO(jeremya): this is a temporary hack to allow moving the window while
|
| + // we still don't have proper draggable region support.
|
| + NSView* controlRegion = [[ControlRegionView alloc] init];
|
| + [controlRegion setFrame:NSMakeRect(0, 0, NSWidth([frameView bounds]),
|
| + NSHeight([frameView bounds]) - 20)];
|
| + [controlRegion setAutoresizingMask:
|
| + NSViewWidthSizable | NSViewHeightSizable];
|
| + [frameView addSubview:controlRegion];
|
| + [controlRegion release];
|
| + }
|
|
|
| window_controller_.reset(
|
| [[ShellWindowController alloc] initWithWindow:window.release()]);
|
|
|