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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 376018: Fix jumping/resize/relayout of NTP/webpages when switching between NTP and an... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/tabs/tab_strip_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 30243)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -1247,8 +1247,8 @@
// We need to reset the current tab contents to NULL before it gets
// freed. This is because the focus manager performs some operations
// on the selected TabContents when it is removed.
+ contents_container_->ChangeTabContents(NULL);
infobar_container_->ChangeTabContents(NULL);
- contents_container_->ChangeTabContents(NULL);
UpdateDevToolsForContents(NULL);
}
}
@@ -1269,8 +1269,22 @@
// Update various elements that are interested in knowing the current
// TabContents.
+
+ // When we toggle the NTP floating bookmarks bar,
+ // we don't want any TabContents to be attached, so that we
+ // avoid an unnecessary resize and re-layout of a TabContents.
+ contents_container_->ChangeTabContents(NULL);
+
infobar_container_->ChangeTabContents(new_contents);
+
+ // Update all the UI bits.
+ UpdateTitleBar();
+ toolbar_->SetProfile(new_contents->profile());
+ UpdateToolbar(new_contents, true);
+ UpdateUIForContents(new_contents);
+
contents_container_->ChangeTabContents(new_contents);
+
UpdateDevToolsForContents(new_contents);
// TODO(beng): This should be called automatically by ChangeTabContents, but I
// am striving for parity now rather than cleanliness. This is
@@ -1283,12 +1297,6 @@
// handlers when we are eventually shown.
new_contents->view()->RestoreFocus();
}
-
- // Update all the UI bits.
- UpdateTitleBar();
- toolbar_->SetProfile(new_contents->profile());
- UpdateToolbar(new_contents, true);
- UpdateUIForContents(new_contents);
}
void BrowserView::TabStripEmpty() {
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698