Commit 497aef07 authored by John Smith's avatar John Smith Committed by Commit Bot

Themes not applied to ntb correctly

Themes with images for the ntb use a calculation to determine the
right part of the image to use. The ntb was recently moved to a new
container (http://crrev.com/c/2333341), which meant that this
calculation wasn't getting the right position anymore. Switch to make
sure that we get the position of the ntb relative to the tabstrip so
it gets the right offset.

Bug: 1123195
Change-Id: I917e13bf342f670bc8f50a0b9da6eb84b3691eed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382429
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803550}
parent ed3ae124
......@@ -186,7 +186,9 @@ void NewTabButton::PaintFill(gfx::Canvas* canvas) const {
if (bg_id.has_value()) {
float x_scale = scale;
const gfx::Rect& contents_bounds = GetContentsBounds();
int x = GetMirroredX() + contents_bounds.x() +
gfx::RectF bounds_in_tab_strip(GetLocalBounds());
View::ConvertRectToTarget(this, tab_strip_, &bounds_in_tab_strip);
int x = bounds_in_tab_strip.x() + contents_bounds.x() +
tab_strip_->GetBackgroundOffset();
if (base::i18n::IsRTL()) {
// The new tab background is mirrored in RTL mode, but the theme
......
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