Chromium Code Reviews| Index: chrome/browser/ui/gtk/extensions/shell_window_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc b/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc |
| index fa59701f5664dc70d231f723cd45789f9501703d..bff76e0d6a07828a3f349d9f48bff51288f06921 100644 |
| --- a/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc |
| +++ b/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc |
| @@ -15,12 +15,38 @@ ShellWindowGtk::ShellWindowGtk(ExtensionHost* host) |
| gtk_container_add(GTK_CONTAINER(window_), host_->view()->native_view()); |
| - // TOOD(mihaip): Allow window dimensions to be specified in manifest (and |
| - // restore prior window dimensions and positions on relaunch). |
| - gtk_widget_set_size_request(GTK_WIDGET(window_), 512, 384); |
| + const Extension* extension = host_->extension(); |
| + |
| + // TOOD(mihaip): restore prior window dimensions and positions on relaunch. |
| + gtk_window_set_default_size( |
| + window_, extension->launch_width(), extension->launch_height()); |
| + |
| + int min_width = extension->launch_min_width(); |
| + int min_height = extension->launch_min_height(); |
| + int max_width = extension->launch_max_width(); |
| + int max_height = extension->launch_max_height(); |
| + GdkGeometry hints; |
| + int hints_mask = 0; |
| + if (min_width || min_height) { |
| + hints.min_height = min_height; |
| + hints.min_width = min_width; |
| + hints_mask |= GDK_HINT_MIN_SIZE; |
| + } |
| + if (max_width || max_height) { |
| + hints.max_height = max_height ? max_height : G_MAXINT; |
|
Mihai Parparita -not on Chrome
2012/03/02 02:01:00
Per http://developer.gnome.org/gdk/stable/gdk-Wind
|
| + hints.max_width = max_width ? max_width : G_MAXINT; |
| + hints_mask |= GDK_HINT_MAX_SIZE; |
| + } |
| + if (hints_mask) { |
| + gtk_window_set_geometry_hints( |
| + window_, |
| + GTK_WIDGET(window_), |
| + &hints, |
| + static_cast<GdkWindowHints>(hints_mask)); |
| + } |
| // TODO(mihaip): Mirror contents of <title> tag in window title |
| - gtk_window_set_title(window_, host->extension()->name().c_str()); |
| + gtk_window_set_title(window_, extension->name().c_str()); |
| g_signal_connect(window_, "delete-event", |
| G_CALLBACK(OnMainWindowDeleteEventThunk), this); |