Index: chrome/browser/ui/gtk/web_intent_picker_gtk.cc |
diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc |
index aa74d13fdc5fb8c2715dc405d383d5f5be429a01..62f4dba1e30be9a19abd094958e50a850c7b2397 100644 |
--- a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc |
+++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc |
@@ -242,7 +242,6 @@ void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, |
std::string()); |
// Replace the picker contents with the inline disposition. |
- |
gtk_util::RemoveAllChildren(contents_); |
Evan Stade
2012/05/18 21:16:07
try removing all children from sub_contents instea
|
GtkWidget* service_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); |
@@ -266,17 +265,27 @@ void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, |
// The separator between the icon/title/close and the inline renderer. |
gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, TRUE, 0); |
- gtk_box_pack_end(GTK_BOX(vbox), tab_contents_container_->widget(), |
- TRUE, TRUE, 0); |
- |
+ // hbox for the web contents, so we can have spacing on the borders. |
+ GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
+ gtk_alignment_set_padding( |
+ GTK_ALIGNMENT(alignment), 0, ui::kContentAreaBorder, |
+ ui::kContentAreaBorder, ui::kContentAreaBorder); |
+ gtk_container_add(GTK_CONTAINER(alignment), |
+ tab_contents_container_->widget()); |
+ gtk_box_pack_end(GTK_BOX(vbox), alignment, TRUE, TRUE, 0); |
gtk_container_add(GTK_CONTAINER(contents_), vbox); |
- gfx::Size size = GetDefaultInlineDispositionSize(web_contents); |
+ gfx::Size size = GetMinInlineDispositionSize(); |
gtk_widget_set_size_request(tab_contents_container_->widget(), |
size.width(), size.height()); |
gtk_widget_show_all(contents_); |
} |
+void WebIntentPickerGtk::OnInlineDispositionAutoResize(const gfx::Size& size) { |
+ gtk_widget_set_size_request(tab_contents_container_->widget(), |
+ size.width(), size.height()); |
+} |
+ |
GtkWidget* WebIntentPickerGtk::GetWidgetRoot() { |
return contents_; |
} |