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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 713
714 void BrowserView::UpdateTitleBar() { 714 void BrowserView::UpdateTitleBar() {
715 frame_->UpdateWindowTitle(); 715 frame_->UpdateWindowTitle();
716 if (ShouldShowWindowIcon() && !loading_animation_timer_.IsRunning()) 716 if (ShouldShowWindowIcon() && !loading_animation_timer_.IsRunning())
717 frame_->UpdateWindowIcon(); 717 frame_->UpdateWindowIcon();
718 } 718 }
719 719
720 void BrowserView::BookmarkBarStateChanged( 720 void BrowserView::BookmarkBarStateChanged(
721 BookmarkBar::AnimateChangeType change_type) { 721 BookmarkBar::AnimateChangeType change_type) {
722 if (bookmark_bar_view_.get()) { 722 if (bookmark_bar_view_.get()) {
723 bookmark_bar_view_->SetBookmarkBarState( 723 BookmarkBar::State new_state = browser_->bookmark_bar_state();
724 browser_->bookmark_bar_state(), change_type); 724
725 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
726 bookmark_bar_view_->IsDetached();
727 // We don't properly support animating the bookmark bar to and from the
728 // detached state in immersive fullscreen.
729 if (to_or_from_detached_state && immersive_mode_controller_->IsEnabled())
730 change_type = BookmarkBar::DONT_ANIMATE_STATE_CHANGE;
731
732 bookmark_bar_view_->SetBookmarkBarState(new_state, change_type);
725 } 733 }
726 if (MaybeShowBookmarkBar(GetActiveWebContents())) 734 if (MaybeShowBookmarkBar(GetActiveWebContents()))
727 Layout(); 735 Layout();
728 } 736 }
729 737
730 void BrowserView::UpdateDevTools() { 738 void BrowserView::UpdateDevTools() {
731 UpdateDevToolsForContents(GetActiveWebContents()); 739 UpdateDevToolsForContents(GetActiveWebContents());
732 Layout(); 740 Layout();
733 } 741 }
734 742
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); 2132 BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
2125 GetBrowserViewLayout()->set_bookmark_bar(bookmark_bar_view_.get()); 2133 GetBrowserViewLayout()->set_bookmark_bar(bookmark_bar_view_.get());
2126 } 2134 }
2127 bookmark_bar_view_->SetVisible(show_bookmark_bar); 2135 bookmark_bar_view_->SetVisible(show_bookmark_bar);
2128 bookmark_bar_view_->SetPageNavigator(contents); 2136 bookmark_bar_view_->SetPageNavigator(contents);
2129 2137
2130 // Update parenting for the bookmark bar. This may detach it from all views. 2138 // Update parenting for the bookmark bar. This may detach it from all views.
2131 bool needs_layout = false; 2139 bool needs_layout = false;
2132 views::View* new_parent = NULL; 2140 views::View* new_parent = NULL;
2133 if (show_bookmark_bar) { 2141 if (show_bookmark_bar) {
2134 if (browser_->bookmark_bar_state() == BookmarkBar::DETACHED) 2142 if (bookmark_bar_view_->IsDetached())
2135 new_parent = this; 2143 new_parent = this;
2136 else 2144 else
2137 new_parent = top_container_; 2145 new_parent = top_container_;
2138 } 2146 }
2139 if (new_parent != bookmark_bar_view_->parent()) { 2147 if (new_parent != bookmark_bar_view_->parent()) {
2140 SetBookmarkBarParent(new_parent); 2148 SetBookmarkBarParent(new_parent);
2141 needs_layout = true; 2149 needs_layout = true;
2142 } 2150 }
2143 2151
2144 // Check for updates to the desired size. 2152 // Check for updates to the desired size.
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
2672 2680
2673 Browser* modal_browser = 2681 Browser* modal_browser =
2674 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); 2682 chrome::FindBrowserWithWebContents(active_dialog->web_contents());
2675 if (modal_browser && (browser_ != modal_browser)) { 2683 if (modal_browser && (browser_ != modal_browser)) {
2676 modal_browser->window()->FlashFrame(true); 2684 modal_browser->window()->FlashFrame(true);
2677 modal_browser->window()->Activate(); 2685 modal_browser->window()->Activate();
2678 } 2686 }
2679 2687
2680 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2688 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2681 } 2689 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698