Chromium Code Reviews

Unified Diff: chrome/browser/gtk/tab_contents_container_gtk.cc

Issue 113545: Linux: Don't unparent unselected tab contentses.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/gtk/tab_contents_container_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tab_contents_container_gtk.cc
===================================================================
--- chrome/browser/gtk/tab_contents_container_gtk.cc (revision 16301)
+++ chrome/browser/gtk/tab_contents_container_gtk.cc (working copy)
@@ -28,7 +28,7 @@
if (tab_contents_) {
gfx::NativeView widget = tab_contents_->GetNativeView();
if (widget)
- gtk_container_remove(GTK_CONTAINER(vbox_), widget);
+ gtk_widget_hide(widget);
tab_contents_->WasHidden();
@@ -44,9 +44,12 @@
gfx::NativeView widget = tab_contents_->GetNativeView();
if (widget) {
- gtk_box_pack_end(GTK_BOX(vbox_), widget, TRUE, TRUE, 0);
+ // Pack it into |vbox_| if it isn't already.
+ if (widget->parent != vbox_)
+ gtk_box_pack_end(GTK_BOX(vbox_), widget, TRUE, TRUE, 0);
gtk_widget_show(widget);
}
+
// We need to make sure that we are below the findbar.
// Sometimes the content native view will be null.
// TODO(estade): will this case ever cause findbar occlusion problems?
@@ -59,6 +62,14 @@
}
}
+void TabContentsContainerGtk::DetachTabContents(TabContents* tab_contents) {
+ gfx::NativeView widget = tab_contents_->GetNativeView();
+ if (widget) {
+ DCHECK_EQ(widget->parent, vbox_);
+ gtk_container_remove(GTK_CONTAINER(vbox_), widget);
+ }
+}
+
void TabContentsContainerGtk::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
« no previous file with comments | « chrome/browser/gtk/tab_contents_container_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine