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

Unified Diff: chrome/browser/ui/views/frame/top_container_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
Index: chrome/browser/ui/views/frame/top_container_view.cc
diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc
index d9768545fa2a16e414509574d472ca70250e50bd..86e865dfb33999e1e0655374e12b10bdbda51d0b 100644
--- a/chrome/browser/ui/views/frame/top_container_view.cc
+++ b/chrome/browser/ui/views/frame/top_container_view.cc
@@ -35,10 +35,15 @@ gfx::Rect TopContainerView::GetTargetBoundsInScreen() const {
gfx::Size TopContainerView::GetPreferredSize() {
// The view wants to be as wide as its parent and tall enough to fully show
- // its last child view.
- int last_child_bottom =
- child_count() > 0 ? child_at(child_count() - 1)->bounds().bottom() : 0;
- return gfx::Size(browser_view_->width(), last_child_bottom);
+ // all its children. In particular, the bottom of the bookmark bar can be
+ // be above the bottom of the toolbar while the bookmark bar is animating.
James Cook 2013/04/25 21:45:21 Good catch.
+ int height = 0;
+ for (int i = 0; i < child_count(); ++i) {
+ int child_bottom = child_at(i)->bounds().bottom();
+ if (child_bottom > height)
+ height = child_bottom;
+ }
+ return gfx::Size(browser_view_->width(), height);
}
std::string TopContainerView::GetClassName() const {

Powered by Google App Engine
This is Rietveld 408576698