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..95396a77337c9f9afa89fecaf8238f86880e33ee 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,10 @@ BookmarkBarViewBackground::BookmarkBarViewBackground( |
void BookmarkBarViewBackground::Paint(gfx::Canvas* canvas, |
views::View* view) const { |
+ // Start with a blank canvas --- the attached and detached colors may not be |
+ // fully opaque. |
+ canvas->DrawColor(SK_ColorWHITE); |
sky
2016/04/05 19:14:01
Why is white the right color here?
Evan Stade
2016/04/05 19:36:10
That is a good question. Initially I used black, b
Evan Stade
2016/04/05 20:31:51
I looked into it and I think that previously the f
|
+ |
int toolbar_overlap = bookmark_bar_view_->GetToolbarOverlap(); |
SkAlpha detached_alpha = static_cast<SkAlpha>( |
@@ -439,7 +441,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(); |
} |