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

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

Issue 13868010: Do not animate detaching / undetaching the bookmark bar in immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/top_container_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..492456791a901f1b48b872f4db280382b08b437d 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();
+
+ // We don't properly support animating the bookmark bar to and from the
+ // detached state in immersive fullscreen.
+ bool detached_changed = (new_state == BookmarkBar::DETACHED) ||
+ bookmark_bar_view_->IsDetached();
+ if (detached_changed && 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_;
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/top_container_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698