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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 3167027: Merge 56737 - Fix numerous alignment problems, both horizontal and vertical, ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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/views/frame/browser_view.h ('k') | chrome/browser/views/frame/browser_view_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 56738)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -200,7 +200,9 @@
if (!toolbar_overlap)
DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_);
} else {
- DetachableToolbarView::PaintBackgroundAttachedMode(canvas, host_view_);
+ DetachableToolbarView::PaintBackgroundAttachedMode(canvas, host_view_,
+ browser_view_->OffsetPointForToolbarBackgroundImage(
+ gfx::Point(host_view_->MirroredX(), host_view_->y())));
if (host_view_->height() >= toolbar_overlap)
DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_);
}
@@ -516,7 +518,16 @@
}
gfx::Rect BrowserView::GetToolbarBounds() const {
- return toolbar_->bounds();
+ gfx::Rect toolbar_bounds(toolbar_->bounds());
+ if (toolbar_bounds.IsEmpty())
+ return toolbar_bounds;
+ // When using vertical tabs, the toolbar appears to extend behind the tab
+ // column.
+ if (UseVerticalTabs())
+ toolbar_bounds.Inset(tabstrip_->x() - toolbar_bounds.x(), 0, 0, 0);
+ // The apparent toolbar edges are outside the "real" toolbar edges.
+ toolbar_bounds.Inset(-views::NonClientFrameView::kClientEdgeThickness, 0);
+ return toolbar_bounds;
}
gfx::Rect BrowserView::GetClientAreaBounds() const {
@@ -544,8 +555,14 @@
return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0;
}
-gfx::Rect BrowserView::GetTabStripBounds() const {
- return frame_->GetBoundsForTabStrip(tabstrip_);
+gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
+ const gfx::Point& point) const {
+ // The background image starts tiling horizontally at the window left edge and
+ // vertically at the top edge of the horizontal tab strip (or where it would
+ // be). We expect our parent's origin to be the window origin.
+ gfx::Point window_point(point.Add(gfx::Point(MirroredX(), y())));
+ window_point.Offset(0, -frame_->GetHorizontalTabStripVerticalOffset(false));
+ return window_point;
}
bool BrowserView::IsTabStripVisible() const {
@@ -1662,11 +1679,12 @@
// Send the margins of the "user-perceived content area" of this
// browser window so AeroPeekManager can render a background-tab image in
// the area.
+ // TODO(pkasting) correct content inset??
if (aeropeek_manager_.get()) {
gfx::Insets insets(GetFindBarBoundingBox().y() + 1,
- GetTabStripBounds().x(),
- GetTabStripBounds().x(),
- GetTabStripBounds().x());
+ 0,
+ 0,
+ 0);
aeropeek_manager_->SetContentInsets(insets);
}
#endif
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | chrome/browser/views/frame/browser_view_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698