Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
| index bfb23b6c32151a007111121d3ec31ebea3c7dc66..81d85653d1e2c92dc4188fc390dfe6224f1ce757 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view.cc |
| @@ -223,17 +223,16 @@ void PaintHorizontalBorder(gfx::Canvas* canvas, |
| // content page in the very near future, at which time, these local functions |
| // will be removed. |
| void PaintDetachedBookmarkBar(gfx::Canvas* canvas, |
| - BookmarkBarView* view, |
| - Profile* profile) { |
| + BookmarkBarView* view) { |
| // Paint background for detached state; if animating, this is fade in/out. |
| - const ui::ThemeProvider& tp = |
| - ThemeService::GetThemeProviderForProfile(profile); |
| + const ui::ThemeProvider* tp = view->GetThemeProvider(); |
| canvas->DrawColor( |
| - tp.GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND)); |
| + tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND)); |
| + |
| // Draw the separators above and below bookmark bar; |
| // if animating, these are fading in/out. |
| SkColor separator_color = |
| - tp.GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); |
| + tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); |
| if (ui::MaterialDesignController::IsModeMaterial()) { |
| BrowserView::Paint1pxHorizontalLine( |
| @@ -262,8 +261,7 @@ void PaintBackgroundAttachedMode(gfx::Canvas* canvas, |
| const ui::ThemeProvider* theme_provider, |
| const gfx::Rect& bounds, |
| const gfx::Point& background_origin) { |
| - canvas->FillRect(bounds, |
| - theme_provider->GetColor(ThemeProperties::COLOR_TOOLBAR)); |
| + canvas->DrawColor(theme_provider->GetColor(ThemeProperties::COLOR_TOOLBAR)); |
| // Always tile the background image in pre-MD. In MD, only tile if there's a |
| // non-default image. |
| @@ -424,6 +422,12 @@ BookmarkBarViewBackground::BookmarkBarViewBackground( |
| void BookmarkBarViewBackground::Paint(gfx::Canvas* canvas, |
| views::View* view) const { |
| + // Start with a frame-colored canvas in case the attached/detached colors |
| + // aren't opaque. |
| + canvas->DrawColor(SK_ColorBLACK); |
| + canvas->DrawColor( |
| + view->GetThemeProvider()->GetColor(ThemeProperties::COLOR_FRAME)); |
|
sky
2016/04/07 18:23:45
Shouldn't this route through BrowserNonClientFrame
Evan Stade
2016/04/07 19:30:24
This comment led me to realize I was wrong about t
|
| + |
| int toolbar_overlap = bookmark_bar_view_->GetToolbarOverlap(); |
| SkAlpha detached_alpha = static_cast<SkAlpha>( |
| @@ -439,7 +443,7 @@ void BookmarkBarViewBackground::Paint(gfx::Canvas* canvas, |
| // While animating, set opacity to cross-fade between attached and detached |
| // backgrounds including their respective separators. |
| canvas->SaveLayerAlpha(detached_alpha); |
| - PaintDetachedBookmarkBar(canvas, bookmark_bar_view_, browser_->profile()); |
| + PaintDetachedBookmarkBar(canvas, bookmark_bar_view_); |
| canvas->Restore(); |
| } |