Chromium Code Reviews| Index: chrome/browser/ui/gtk/html_dialog_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/html_dialog_gtk.cc b/chrome/browser/ui/gtk/html_dialog_gtk.cc |
| index 4fa270ff9d89bf99b865d31ac028e3bb2def5da1..f9e3b619394300537b0ea4b740b7f09123be403c 100644 |
| --- a/chrome/browser/ui/gtk/html_dialog_gtk.cc |
| +++ b/chrome/browser/ui/gtk/html_dialog_gtk.cc |
| @@ -114,6 +114,13 @@ void HtmlDialogGtk::GetDialogSize(gfx::Size* size) const { |
| *size = gfx::Size(); |
| } |
| +void HtmlDialogGtk::GetMinimumDialogSize(gfx::Size* size) const { |
| + if (delegate_) |
| + delegate_->GetMinimumDialogSize(size); |
| + else |
| + *size = gfx::Size(); |
| +} |
| + |
| std::string HtmlDialogGtk::GetDialogArgs() const { |
| if (delegate_) |
| return delegate_->GetDialogArgs(); |
| @@ -245,10 +252,18 @@ gfx::NativeWindow HtmlDialogGtk::InitDialog() { |
| gfx::Size dialog_size; |
| delegate_->GetDialogSize(&dialog_size); |
| - |
| - gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), |
| - dialog_size.width(), |
| - dialog_size.height()); |
| + if (!dialog_size.IsEmpty()) { |
| + gtk_window_set_default_size(GTK_WINDOW(dialog_), |
| + dialog_size.width(), |
| + dialog_size.height()); |
| + } |
| + gfx::Size minimum_dialog_size; |
| + delegate_->GetMinimumDialogSize(&minimum_dialog_size); |
| + if (!minimum_dialog_size.IsEmpty()) { |
| + gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), |
| + minimum_dialog_size.width(), |
| + minimum_dialog_size.height()); |
|
Elliot Glaysher
2012/03/12 21:16:32
This is fine as long as your code still works if t
|
| + } |
| gtk_widget_show_all(dialog_); |