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

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: renames, don't const_cast, ditch InfoBarView::VerticalOffset. Created 9 years, 9 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..e8632a4f79d91dfe9101edd173c2bf5e67f41f7a 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -362,12 +362,18 @@ 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;
infobar_container_->SetVisible(visible);
- infobar_container_->SetBounds(vertical_layout_rect_.x(), top,
- vertical_layout_rect_.width(), height);
- return top + height;
+ int height = infobar_container_->GetPreferredSize().height();
+ DCHECK(visible || !height) << "Invisible InfoBarContainer has height.";
+ int overlapped_top = top -
+ static_cast<InfoBarContainer*>(infobar_container_)->VerticalOverlap();
+ infobar_container_->SetBounds(vertical_layout_rect_.x(),
+ overlapped_top,
+ vertical_layout_rect_.width(),
+ height);
+ return overlapped_top + height;
}
// |browser_reserved_rect| is in browser_view_ coordinates.

Powered by Google App Engine
This is Rietveld 408576698