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

Unified Diff: chrome/browser/ui/gtk/html_dialog_gtk.cc

Issue 9569001: WebUI TaskManager: Add method to set minimum window size on HTMLDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: prevent from failing the tests Created 8 years, 9 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 | « chrome/browser/ui/gtk/html_dialog_gtk.h ('k') | chrome/browser/ui/views/html_dialog_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+ }
gtk_widget_show_all(dialog_);
« no previous file with comments | « chrome/browser/ui/gtk/html_dialog_gtk.h ('k') | chrome/browser/ui/views/html_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698