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

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

Issue 6609047: [linux_views][Win] spoof proof redesign infobar extension with tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698