Chromium Code Reviews| Index: chrome/browser/ui/gtk/browser_window_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc |
| index 48fd65cbdf9e4484326fe11ba7baa74245303ea4..6ba7c117c6b2ecbc545a91290b7cb11be97a9874 100644 |
| --- a/chrome/browser/ui/gtk/browser_window_gtk.cc |
| +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc |
| @@ -1253,8 +1253,9 @@ void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents, |
| // Update all the UI bits. |
| UpdateTitleBar(); |
| - UpdateToolbar(new_contents, true); |
| MaybeShowBookmarkBar(false); |
| + // It's the Browser object's responsibility to update our toolbar; this |
|
Evan Stade
2011/11/12 00:06:26
I don't think this comment is strictly necessary a
|
| + // already happened before this Observer method was called. |
| } |
| void BrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { |
| @@ -2353,21 +2354,25 @@ bool BrowserWindowGtk::BoundsMatchMonitorSize() { |
| } |
| void BrowserWindowGtk::PlaceBookmarkBar(bool is_floating) { |
| - GtkWidget* parent = gtk_widget_get_parent(bookmark_bar_->widget()); |
| - if (parent) |
| - gtk_container_remove(GTK_CONTAINER(parent), bookmark_bar_->widget()); |
| - |
| + GtkWidget* target_parent = NULL; |
| if (!is_floating) { |
| // Place the bookmark bar at the end of |window_vbox_|; this happens after |
| // we have placed the render area at the end of |window_vbox_| so we will |
| // be above the render area. |
| - gtk_box_pack_end(GTK_BOX(window_vbox_), bookmark_bar_->widget(), |
| - FALSE, FALSE, 0); |
| + target_parent = window_vbox_; |
| } else { |
| // Place the bookmark bar at the end of the render area; this happens after |
| // the tab contents container has been placed there so we will be |
| // above the webpage (in terms of y). |
| - gtk_box_pack_end(GTK_BOX(render_area_vbox_), bookmark_bar_->widget(), |
| + target_parent = render_area_vbox_; |
| + } |
| + |
| + GtkWidget* parent = gtk_widget_get_parent(bookmark_bar_->widget()); |
| + if (parent != target_parent) { |
| + if (parent) |
| + gtk_container_remove(GTK_CONTAINER(parent), bookmark_bar_->widget()); |
| + |
| + gtk_box_pack_end(GTK_BOX(target_parent), bookmark_bar_->widget(), |
| FALSE, FALSE, 0); |
| } |
| } |