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

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 8537022: GTK: Shave ~15ms off each tab change. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move comment to description Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..774bd6ae9ebc67ae7acc645cf2d8529112254ee9 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -1253,7 +1253,6 @@ void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents,
// Update all the UI bits.
UpdateTitleBar();
- UpdateToolbar(new_contents, true);
MaybeShowBookmarkBar(false);
}
@@ -2353,21 +2352,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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698