Chromium Code Reviews| 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 f8e33791e4138ae8df6187252abb3f9dbcbcc68a..afc93f9056522ee7aa33b0f16d87bd2680941a64 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view.cc |
| @@ -720,8 +720,16 @@ void BrowserView::UpdateTitleBar() { |
| void BrowserView::BookmarkBarStateChanged( |
| BookmarkBar::AnimateChangeType change_type) { |
| if (bookmark_bar_view_.get()) { |
| - bookmark_bar_view_->SetBookmarkBarState( |
| - browser_->bookmark_bar_state(), change_type); |
| + BookmarkBar::State new_state = browser_->bookmark_bar_state(); |
| + |
| + bool to_or_from_detached_state = (new_state == BookmarkBar::DETACHED) || |
|
James Cook
2013/04/25 21:45:21
optional nit: This variable name is fine, but long
|
| + bookmark_bar_view_->IsDetached(); |
| + // We don't properly support animating the bookmark bar to and from the |
| + // detached state in immersive fullscreen. |
| + if (to_or_from_detached_state && immersive_mode_controller_->IsEnabled()) |
| + change_type = BookmarkBar::DONT_ANIMATE_STATE_CHANGE; |
| + |
| + bookmark_bar_view_->SetBookmarkBarState(new_state, change_type); |
| } |
| if (MaybeShowBookmarkBar(GetActiveWebContents())) |
| Layout(); |
| @@ -2131,7 +2139,7 @@ bool BrowserView::MaybeShowBookmarkBar(WebContents* contents) { |
| bool needs_layout = false; |
| views::View* new_parent = NULL; |
| if (show_bookmark_bar) { |
| - if (browser_->bookmark_bar_state() == BookmarkBar::DETACHED) |
| + if (bookmark_bar_view_->IsDetached()) |
| new_parent = this; |
| else |
| new_parent = top_container_; |