| 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 872c2e236d17668555f5c5f44b3a6150110435b0..07c46753ebcbd57f662ec36c81b075550de9308e 100644
|
| --- a/chrome/browser/ui/views/frame/browser_view_layout.cc
|
| +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
|
| @@ -222,7 +222,7 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) {
|
| break;
|
| }
|
| case VIEW_ID_INFO_BAR_CONTAINER:
|
| - infobar_container_ = view;
|
| + infobar_container_ = static_cast<InfoBarContainer*>(view);
|
| break;
|
| case VIEW_ID_DOWNLOAD_SHELF:
|
| download_shelf_ = static_cast<DownloadShelfView*>(view);
|
| @@ -362,12 +362,16 @@ int BrowserViewLayout::LayoutBookmarkBar(int top) {
|
| }
|
|
|
| int BrowserViewLayout::LayoutInfoBar(int top) {
|
| + // Raise the |infobar_container_| by its overlapping tab_height.
|
| bool visible = InfobarVisible();
|
| - int height = visible ? infobar_container_->GetPreferredSize().height() : 0;
|
| + InfoBarContainer::Heights heights = visible ?
|
| + infobar_container_->GetHeights() : InfoBarContainer::Heights(0, 0);
|
| infobar_container_->SetVisible(visible);
|
| - infobar_container_->SetBounds(vertical_layout_rect_.x(), top,
|
| - vertical_layout_rect_.width(), height);
|
| - return top + height;
|
| + infobar_container_->SetBounds(vertical_layout_rect_.x(),
|
| + top - heights.tab_height(),
|
| + vertical_layout_rect_.width(),
|
| + heights.height());
|
| + return top + heights.bar_height();
|
| }
|
|
|
| // |browser_reserved_rect| is in browser_view_ coordinates.
|
| @@ -520,5 +524,5 @@ int BrowserViewLayout::LayoutDownloadShelf(int bottom) {
|
| bool BrowserViewLayout::InfobarVisible() const {
|
| // NOTE: Can't check if the size IsEmpty() since it's always 0-width.
|
| return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) &&
|
| - (infobar_container_->GetPreferredSize().height() != 0);
|
| + (infobar_container_->GetHeights().height() != 0);
|
| }
|
|
|