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

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

Issue 16021009: Redo display of web contents modal dialog under the bookmark bar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle detached bookmarks bar Created 7 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ae16beb6c1678e2bf91a1330abd1398ece97960f..d0cbeda9a922fbca847cf6290fb030905dfb6d0f 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -333,9 +333,6 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
}
top = LayoutToolbar(top);
- web_contents_modal_dialog_top_y_ =
- top + browser_view->y() - kConstrainedWindowOverlap;
-
// Overlay container requires updated toolbar bounds to determine its
// position, and needs to be laid out before:
// - GetTopMarginForActiveContent(), which calls GetInstantUIState() to check
@@ -345,7 +342,7 @@ void BrowserViewLayout::Layout(views::View* browser_view) {
// visible.
LayoutOverlayContainer();
- top = LayoutBookmarkAndInfoBars(top);
+ top = LayoutBookmarkAndInfoBars(top, browser_view->y());
// Top container requires updated toolbar and bookmark bar to compute size.
top_container_->SetSize(top_container_->GetPreferredSize());
@@ -449,16 +446,23 @@ int BrowserViewLayout::LayoutToolbar(int top) {
return y + height;
}
-int BrowserViewLayout::LayoutBookmarkAndInfoBars(int top) {
+int BrowserViewLayout::LayoutBookmarkAndInfoBars(int top, int browser_view_y) {
if (bookmark_bar_) {
// If we're showing the Bookmark bar in detached style, then we
// need to show any Info bar _above_ the Bookmark bar, since the
// Bookmark bar is styled to look like it's part of the page.
- if (bookmark_bar_->IsDetached())
+ if (bookmark_bar_->IsDetached()) {
+ web_contents_modal_dialog_top_y_ =
+ top + browser_view_y - kConstrainedWindowOverlap;
return LayoutBookmarkBar(LayoutInfoBar(top));
+ }
// Otherwise, Bookmark bar first, Info bar second.
top = std::max(toolbar_->bounds().bottom(), LayoutBookmarkBar(top));
}
+
+ web_contents_modal_dialog_top_y_ =
+ top + browser_view_y - kConstrainedWindowOverlap;
+
return LayoutInfoBar(top);
}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698