diff options
-rw-r--r-- | chrome/browser/gtk/tab_contents_container_gtk.cc | 19 | ||||
-rw-r--r-- | chrome/browser/gtk/tab_contents_container_gtk.h | 3 |
2 files changed, 12 insertions, 10 deletions
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.cc b/chrome/browser/gtk/tab_contents_container_gtk.cc index 41d2d9a..d55f9ca 100644 --- a/chrome/browser/gtk/tab_contents_container_gtk.cc +++ b/chrome/browser/gtk/tab_contents_container_gtk.cc @@ -34,6 +34,7 @@ TabContentsContainerGtk::TabContentsContainerGtk(StatusBubbleGtk* status_bubble) } TabContentsContainerGtk::~TabContentsContainerGtk() { + floating_.Destroy(); } void TabContentsContainerGtk::Init() { @@ -45,29 +46,29 @@ void TabContentsContainerGtk::Init() { // || || // || || // || || - // |+- (StatusBubble) ------+ +- (Popups) ------------+| - // |+ +----------------+ || - // |+-----------------------+ +-----------------------+| + // |+- (StatusBubble) ------+ || + // |+ + || + // |+-----------------------+----------------------------------------+| // +------------------------------------------------------------------+ - floating_ = gtk_floating_container_new(); + floating_.Own(gtk_floating_container_new()); fixed_ = gtk_fixed_new(); g_signal_connect(fixed_, "size-allocate", G_CALLBACK(OnFixedSizeAllocate), this); - gtk_container_add(GTK_CONTAINER(floating_), fixed_); + gtk_container_add(GTK_CONTAINER(floating_.get()), fixed_); - gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_), + gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_.get()), status_bubble_->widget()); - g_signal_connect(floating_, "set-floating-position", + g_signal_connect(floating_.get(), "set-floating-position", G_CALLBACK(OnSetFloatingPosition), this); gtk_widget_show(fixed_); - gtk_widget_show(floating_); + gtk_widget_show(floating_.get()); } void TabContentsContainerGtk::AddContainerToBox(GtkWidget* box) { - gtk_box_pack_start(GTK_BOX(box), floating_, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), floating_.get(), TRUE, TRUE, 0); } void TabContentsContainerGtk::SetTabContents(TabContents* tab_contents) { diff --git a/chrome/browser/gtk/tab_contents_container_gtk.h b/chrome/browser/gtk/tab_contents_container_gtk.h index d6df96c..ec524a5 100644 --- a/chrome/browser/gtk/tab_contents_container_gtk.h +++ b/chrome/browser/gtk/tab_contents_container_gtk.h @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "chrome/common/notification_registrar.h" +#include "chrome/common/owned_widget_gtk.h" class RenderViewHost; class StatusBubbleGtk; @@ -80,7 +81,7 @@ class TabContentsContainerGtk : public NotificationObserver { // GtkBin and a GtkFixed, |floating_| has |fixed_| as its one "real" child, // and the various things that hang off the bottom (status bubble, etc) have // their positions manually set in OnSetFloatingPosition. - GtkWidget* floating_; + OwnedWidgetGtk floating_; // We insert and remove TabContents GtkWidgets into this fixed_. This should // not be a GtkVBox since there were errors with timing where the vbox was |