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

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

Issue 507022: Fix issue 11258: Linux: gracefully handle small browser window... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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/gtk/tab_contents_container_gtk.h ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.cc » ('j') | 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 34953)
+++ chrome/browser/gtk/tab_contents_container_gtk.cc (working copy)
@@ -6,30 +6,13 @@
#include "app/gfx/native_widget_types.h"
#include "app/l10n_util.h"
+#include "chrome/browser/gtk/gtk_expanded_container.h"
#include "chrome/browser/gtk/gtk_floating_container.h"
#include "chrome/browser/gtk/status_bubble_gtk.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/common/notification_service.h"
-namespace {
-
-// Allocates all normal tab contents views to the size of the passed in
-// |allocation|.
-void ResizeChildren(GtkWidget* widget, void* param) {
- GtkAllocation* allocation = reinterpret_cast<GtkAllocation*>(param);
- if (!GTK_WIDGET_VISIBLE(widget))
- return;
-
- if (widget->allocation.width != allocation->width ||
- widget->allocation.height != allocation->height) {
- gtk_widget_set_size_request(widget, allocation->width,
- allocation->height);
- }
-}
-
-} // namespace
-
TabContentsContainerGtk::TabContentsContainerGtk(StatusBubbleGtk* status_bubble)
: tab_contents_(NULL),
status_bubble_(status_bubble) {
@@ -44,7 +27,7 @@
// A high level overview of the TabContentsContainer:
//
// +- GtkFloatingContainer |floating_| -------------------------------+
- // |+- GtkFixedContainer |fixed_| -----------------------------------+|
+ // |+- GtkExpandedContainer |expanded_| -----------------------------+|
// || ||
// || ||
// || ||
@@ -57,10 +40,8 @@
floating_.Own(gtk_floating_container_new());
gtk_widget_set_name(floating_.get(), "chrome-tab-contents-container");
- fixed_ = gtk_fixed_new();
- g_signal_connect(fixed_, "size-allocate",
- G_CALLBACK(OnFixedSizeAllocate), this);
- gtk_container_add(GTK_CONTAINER(floating_.get()), fixed_);
+ expanded_ = gtk_expanded_container_new();
+ gtk_container_add(GTK_CONTAINER(floating_.get()), expanded_);
if (status_bubble_) {
gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_.get()),
@@ -69,7 +50,7 @@
G_CALLBACK(OnSetFloatingPosition), this);
}
- gtk_widget_show(fixed_);
+ gtk_widget_show(expanded_);
gtk_widget_show(floating_.get());
ViewIDUtil::SetDelegateForWidget(widget(), this);
@@ -105,8 +86,8 @@
gfx::NativeView widget = tab_contents_->GetNativeView();
if (widget) {
- if (widget->parent != fixed_)
- gtk_fixed_put(GTK_FIXED(fixed_), widget, 0, 0);
+ if (widget->parent != expanded_)
+ gtk_container_add(GTK_CONTAINER(expanded_), widget);
gtk_widget_show(widget);
}
@@ -127,8 +108,8 @@
// It is possible to detach an unrealized, unparented TabContents if you
// slow things down enough in valgrind. Might happen in the real world, too.
if (widget && widget->parent) {
- DCHECK_EQ(widget->parent, fixed_);
- gtk_container_remove(GTK_CONTAINER(fixed_), widget);
+ DCHECK_EQ(widget->parent, expanded_);
+ gtk_container_remove(GTK_CONTAINER(expanded_), widget);
}
}
@@ -176,15 +157,6 @@
// -----------------------------------------------------------------------------
// static
-void TabContentsContainerGtk::OnFixedSizeAllocate(
- GtkWidget* fixed,
- GtkAllocation* allocation,
- TabContentsContainerGtk* container) {
- // Set all the tab contents GtkWidgets to the size of the allocation.
- gtk_container_foreach(GTK_CONTAINER(fixed), ResizeChildren, allocation);
-}
-
-// static
void TabContentsContainerGtk::OnSetFloatingPosition(
GtkFloatingContainer* floating_container, GtkAllocation* allocation,
TabContentsContainerGtk* tab_contents_container) {
« no previous file with comments | « chrome/browser/gtk/tab_contents_container_gtk.h ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698