| Index: chrome/browser/ui/views/infobars/infobar_background.cc
|
| diff --git a/chrome/browser/ui/views/infobars/infobar_background.cc b/chrome/browser/ui/views/infobars/infobar_background.cc
|
| index 5e62559bd3b8aa757c3b9f5c5fa5cc70157511ed..4e53fd9ab825c2dea0597c583dbc6214aa04f01f 100644
|
| --- a/chrome/browser/ui/views/infobars/infobar_background.cc
|
| +++ b/chrome/browser/ui/views/infobars/infobar_background.cc
|
| @@ -7,67 +7,20 @@
|
| #include "chrome/browser/ui/infobar_container_delegate.h"
|
| #include "chrome/browser/ui/views/infobars/infobar_view.h"
|
| #include "components/infobars/core/infobar.h"
|
| -#include "third_party/skia/include/effects/SkGradientShader.h"
|
| #include "ui/base/material_design/material_design_controller.h"
|
| #include "ui/gfx/canvas.h"
|
| -#include "ui/gfx/color_utils.h"
|
| #include "ui/gfx/scoped_canvas.h"
|
| #include "ui/views/view.h"
|
|
|
| InfoBarBackground::InfoBarBackground(
|
| - infobars::InfoBarDelegate::Type infobar_type)
|
| - : top_color_(infobars::InfoBar::GetTopColor(infobar_type)),
|
| - bottom_color_(infobars::InfoBar::GetBottomColor(infobar_type)) {
|
| - SetNativeControlColor(
|
| - color_utils::AlphaBlend(top_color_, bottom_color_, 128));
|
| + infobars::InfoBarDelegate::Type infobar_type) {
|
| + SetNativeControlColor(infobars::InfoBar::GetTopColor(infobar_type));
|
| }
|
|
|
| InfoBarBackground::~InfoBarBackground() {
|
| }
|
|
|
| void InfoBarBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
|
| - if (ui::MaterialDesignController::IsModeMaterial()) {
|
| - PaintMd(canvas, view);
|
| - return;
|
| - }
|
| -
|
| - SkPoint gradient_points[2];
|
| - gradient_points[0].iset(0, 0);
|
| - gradient_points[1].iset(0, view->height());
|
| - SkColor gradient_colors[2] = {top_color_, bottom_color_};
|
| - SkPaint paint;
|
| - paint.setStrokeWidth(
|
| - SkIntToScalar(InfoBarContainerDelegate::kSeparatorLineHeight));
|
| - paint.setStyle(SkPaint::kFill_Style);
|
| - paint.setStrokeCap(SkPaint::kRound_Cap);
|
| - paint.setShader(SkGradientShader::MakeLinear(
|
| - gradient_points, gradient_colors, nullptr, 2, SkShader::kClamp_TileMode));
|
| -
|
| - SkCanvas* canvas_skia = canvas->sk_canvas();
|
| - InfoBarView* infobar = static_cast<InfoBarView*>(view);
|
| - canvas_skia->drawPath(infobar->fill_path(), paint);
|
| -
|
| - paint.setShader(nullptr);
|
| - SkColor separator_color =
|
| - infobar->container_delegate()->GetInfoBarSeparatorColor();
|
| - paint.setColor(SkColorSetA(separator_color, SkColorGetA(gradient_colors[0])));
|
| - paint.setStyle(SkPaint::kStroke_Style);
|
| - // Anti-alias the path so it doesn't look goofy when the edges are not at 45
|
| - // degree angles, but don't anti-alias anything else, especially not the fill,
|
| - // lest we get weird color bleeding problems.
|
| - paint.setAntiAlias(true);
|
| - canvas_skia->drawPath(infobar->stroke_path(), paint);
|
| - paint.setAntiAlias(false);
|
| -
|
| - // Now draw the separator at the bottom.
|
| - canvas->FillRect(
|
| - gfx::Rect(0,
|
| - view->height() - InfoBarContainerDelegate::kSeparatorLineHeight,
|
| - view->width(), InfoBarContainerDelegate::kSeparatorLineHeight),
|
| - separator_color);
|
| -}
|
| -
|
| -void InfoBarBackground::PaintMd(gfx::Canvas* canvas, views::View* view) const {
|
| InfoBarView* infobar = static_cast<InfoBarView*>(view);
|
| const infobars::InfoBarContainer::Delegate* delegate =
|
| infobar->container_delegate();
|
| @@ -112,7 +65,7 @@ void InfoBarBackground::PaintMd(gfx::Canvas* canvas, views::View* view) const {
|
| fill_path.addRect(0, arrow_height, infobar_width, scale(infobar->height()));
|
| SkPaint fill;
|
| fill.setStyle(SkPaint::kFill_Style);
|
| - fill.setColor(top_color_);
|
| + fill.setColor(get_color());
|
| canvas->DrawPath(fill_path, fill);
|
|
|
| SkPaint stroke;
|
|
|