Commit 3a71aae9 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Correctly align the toolbar background image with the tabstrip.

Bug: 866671
Change-Id: Ibee4b8efc16008d4d181b3008860858c9d75efa5
Reviewed-on: https://chromium-review.googlesource.com/1157872
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579983}
parent 7289cfc6
......@@ -614,11 +614,14 @@ void ToolbarView::OnPaintBackground(gfx::Canvas* canvas) {
const ui::ThemeProvider* tp = GetThemeProvider();
if (tp->HasCustomImage(IDR_THEME_TOOLBAR)) {
canvas->TileImageInt(
*tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR),
bounds().x() +
browserView()->frame()->GetFrameView()->GetThemeBackgroundXInset(),
bounds().y(), 0, 0, width(), height());
const int x_offset =
GetMirroredX() + browser_view_->GetMirroredX() +
browser_view_->frame()->GetFrameView()->GetThemeBackgroundXInset();
const int y_offset = GetLayoutConstant(TAB_HEIGHT) -
Tab::GetStrokeHeight() -
GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
canvas->TileImageInt(*tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR), x_offset,
y_offset, 0, 0, width(), height());
} else {
canvas->FillRect(GetLocalBounds(),
tp->GetColor(ThemeProperties::COLOR_TOOLBAR));
......
......@@ -106,7 +106,6 @@ class ToolbarView : public views::AccessiblePaneView,
// Accessors.
Browser* browser() const { return browser_; }
BrowserView* browserView() const { return browser_view_; }
BrowserActionsContainer* browser_actions() const { return browser_actions_; }
ToolbarButton* back_button() const { return back_; }
ReloadButton* reload_button() const { return reload_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment