Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view_layout.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc |
| index 8dce1080e3d20a3e0078a0a9aa6c9860f9d38b91..793490ef95d515a94e69711f8c78f800dc16d443 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view_layout.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc |
| @@ -523,13 +523,32 @@ void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { |
| } |
| void BrowserViewLayout::UpdateTopContainerBounds() { |
| - gfx::Rect top_container_bounds(top_container_->GetPreferredSize()); |
| + // Set the bounds of the top container view such that it is tall enough to |
| + // fully show all of its children. In particular, the bottom of the bookmark |
| + // bar can be above the bottom of the toolbar while the bookmark bar is |
| + // animating. The top container view is positioned relative to the top of the |
| + // client view instead of relative to GetTopInsetInBrowserView() because the |
| + // top container view paints parts of the frame (title, window controls) |
| + // during an immersive fullscreen reveal. |
| + int height = 0; |
| + for (int i = 0; i < top_container_->child_count(); ++i) { |
| + views::View* child = top_container_->child_at(i); |
| + if (!child->visible()) |
| + continue; |
| + int child_bottom = child->bounds().bottom(); |
| + if (child_bottom > height) |
| + height = child_bottom; |
| + } |
| + |
| + // Ensure that the top container view reaches the topmost view in the |
| + // ClientView because the bounds of the top container view are used in |
| + // layout and we assume that this is the case. |
| + height = std::max(height, delegate_->GetTopInsetInBrowserView()); |
|
pkotwicz
2014/02/12 01:43:36
I moved the computation of the preferred width and
|
| + |
| + gfx::Rect top_container_bounds(browser_view_->width(), height); |
| // If the immersive mode controller is animating the top container, it may be |
| - // partly offscreen. The top container is positioned relative to the top of |
| - // the client view instead of relative to GetTopInsetInBrowserView() because |
| - // the top container paints parts of the frame (title, window controls) during |
| - // an immersive reveal. |
| + // partly offscreen. |
| top_container_bounds.set_y( |
| immersive_mode_controller_->GetTopContainerVerticalOffset( |
| top_container_bounds.size())); |