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 5b799da28534748954a0543de1db651ef729dd06..9c971544b32d5f3552ced13a0ce450373fc93afd 100644 |
| --- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm |
| @@ -21,9 +21,10 @@ |
| @end |
| ShellWindowCocoa::ShellWindowCocoa(ExtensionHost* host) : ShellWindow(host) { |
| - // TOOD(mihaip): Allow window dimensions to be specified in manifest (and |
| - // restore prior window dimensions and positions on relaunch). |
| - NSRect rect = NSMakeRect(0, 0, 512, 384); |
| + // TOOD(mihaip): Restore prior window dimensions and positions on relaunch. |
| + NSRect rect = NSZeroRect; |
| + rect.size.width = host_->extension()->launch_width(); |
| + rect.size.height = host_->extension()->launch_height(); |
|
jeremy
2012/02/23 13:21:40
What if the launch_width is larger than the screen
sail
2012/02/23 19:42:34
When a window is shown it is automatically resized
|
| NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask | |
| NSMiniaturizableWindowMask | NSResizableWindowMask; |
| scoped_nsobject<NSWindow> window( |
| @@ -32,6 +33,9 @@ ShellWindowCocoa::ShellWindowCocoa(ExtensionHost* host) : ShellWindow(host) { |
| backing:NSBackingStoreBuffered |
| defer:NO]); |
| [window setTitle:base::SysUTF8ToNSString(host->extension()->name())]; |
| + [window setContentMinSize: |
| + NSMakeSize(host_->extension()->launch_min_width(), |
| + host_->extension()->launch_min_height())]; |
| NSView* view = host->view()->native_view(); |
| [view setFrame:rect]; |