summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_titlebar.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 23:33:21 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 23:33:21 +0000
commit61ad504c0f0aac25fe09531c33aad912966f5cd1 (patch)
tree79f348d54af29812d7af93adcdfa919b1b902de3 /chrome/browser/gtk/browser_titlebar.cc
parent4ac7e43107e67a7a3b534b5efe9e7791378594f1 (diff)
downloadchromium_src-61ad504c0f0aac25fe09531c33aad912966f5cd1.zip
chromium_src-61ad504c0f0aac25fe09531c33aad912966f5cd1.tar.gz
chromium_src-61ad504c0f0aac25fe09531c33aad912966f5cd1.tar.bz2
Fix a bug where we tried to get the position of the tabstrip
but the tabstrip wasn't in our widget hierarchy for app mode windows. Now we always put the tabstrip in the hierarchy, even if we don't show it. BUG=18202 Review URL: http://codereview.chromium.org/159745 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.cc')
-rw-r--r--chrome/browser/gtk/browser_titlebar.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc
index b9a10d3..11d3499 100644
--- a/chrome/browser/gtk/browser_titlebar.cc
+++ b/chrome/browser/gtk/browser_titlebar.cc
@@ -111,13 +111,14 @@ void BrowserTitlebar::Init() {
// If we're a popup window or in app mode, we don't display the spy guy or
// the tab strip. Instead, put an hbox in titlebar_alignment_ in place of
// the tab strip.
- // +- Alignment (titlebar_alignment_) ----------------------------+
- // |+ HBox ------------------------------------------------------+|
- // ||+- Image (app_mode_favicon_) -++- Label (app_mode_title_) -+||
- // ||| favicon || page title |||
- // ||+-----------------------------++---------------------------+||
- // |+------------------------------------------------------------+|
- // +--------------------------------------------------------------+
+ // +- Alignment (titlebar_alignment_) -----------------------------------+
+ // |+ HBox -------------------------------------------------------------+|
+ // ||+- TabStripGtk -++- Image ----------------++- Label --------------+||
+ // ||| hidden ++ (app_mode_favicon_) || (app_mode_title_) |||
+ // ||| || favicon || page title |||
+ // ||+---------------++------------------------++----------------------+||
+ // |+-------------------------------------------------------------------+|
+ // +---------------------------------------------------------------------+
GtkWidget* container_hbox = gtk_hbox_new(FALSE, 0);
container_ = gtk_event_box_new();
@@ -160,6 +161,12 @@ void BrowserTitlebar::Init() {
GtkWidget* app_mode_hbox = gtk_hbox_new(FALSE, kIconTitleSpacing);
gtk_container_add(GTK_CONTAINER(titlebar_alignment_), app_mode_hbox);
+ // Put the tab strip in the hbox even though we don't show it. Sometimes
+ // we need the position of the tab strip so make sure it's in our widget
+ // hierarchy.
+ gtk_box_pack_start(GTK_BOX(app_mode_hbox),
+ browser_window_->tabstrip()->widget(), FALSE, FALSE, 0);
+
// We use the app logo as a placeholder image so the title doesn't jump
// around.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();