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

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

Issue 573893003: Avoid unnecessary visibility changes to BookmarkBarView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 6 years, 3 months 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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index ba11a2b93cc3831299909cffab0e57165aebf508..ef5a0d3b95a81967491c16d8fdbd11be7df6a04d 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -782,6 +782,14 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
devtools_web_view_->SetWebContents(NULL);
}
+ // Do this before updating InfoBarContainer as the InfoBarContainer may
+ // callback to us and trigger layout.
+ if (bookmark_bar_view_.get()) {
+ bookmark_bar_view_->SetBookmarkBarState(
+ browser_->bookmark_bar_state(),
+ BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
+ }
+
infobar_container_->ChangeInfoBarManager(
InfoBarService::FromWebContents(new_contents));
@@ -793,11 +801,6 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
permission_bubble_view_.get());
}
- if (bookmark_bar_view_.get()) {
- bookmark_bar_view_->SetBookmarkBarState(
- browser_->bookmark_bar_state(),
- BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
- }
UpdateUIForContents(new_contents);
// Layout for DevTools _before_ setting the both main and devtools WebContents
@@ -2047,8 +2050,9 @@ bool BrowserView::MaybeShowBookmarkBar(WebContents* contents) {
BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
GetBrowserViewLayout()->set_bookmark_bar(bookmark_bar_view_.get());
}
- bookmark_bar_view_->SetVisible(show_bookmark_bar);
- bookmark_bar_view_->SetPageNavigator(contents);
+ // Don't change the visibility of the BookmarkBarView. BrowserViewLayout
+ // handles it.
+ bookmark_bar_view_->SetPageNavigator(GetActiveWebContents());
// Update parenting for the bookmark bar. This may detach it from all views.
bool needs_layout = false;

Powered by Google App Engine
This is Rietveld 408576698