Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 9453005: Set platform app window size on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698