Chromium Code Reviews| Index: components/infobars/core/infobar.cc |
| diff --git a/components/infobars/core/infobar.cc b/components/infobars/core/infobar.cc |
| index 29c1995a960a2955af6ea3879fab63841f8cb6ab..497803c3a2f6536b056abb62b699d80ee563627d 100644 |
| --- a/components/infobars/core/infobar.cc |
| +++ b/components/infobars/core/infobar.cc |
| @@ -10,10 +10,19 @@ |
| #include "build/build_config.h" |
| #include "components/infobars/core/infobar_container.h" |
| #include "components/infobars/core/infobar_manager.h" |
| +#include "ui/base/resource/material_design/material_design_controller.h" |
| #include "ui/gfx/animation/slide_animation.h" |
| namespace infobars { |
| +namespace { |
| + |
| +static const SkColor kWarningBackgroundColorMd = |
| + SkColorSetRGB(0xFF, 0xEC, 0xB3); // Yellow |
| +static const SkColor kPageActionBackgroundColorMd = SK_ColorWHITE; |
|
Peter Kasting
2015/09/02 21:46:10
Nit: Put these in GetTopColor() so they're next to
Evan Stade
2015/09/02 23:34:35
done
|
| + |
| +} // namespace |
| + |
| InfoBar::InfoBar(scoped_ptr<InfoBarDelegate> delegate) |
| : owner_(NULL), |
| delegate_(delegate.Pass()), |
| @@ -35,6 +44,11 @@ InfoBar::~InfoBar() { |
| // static |
| SkColor InfoBar::GetTopColor(InfoBarDelegate::Type infobar_type) { |
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
| + return infobar_type == InfoBarDelegate::WARNING_TYPE ? |
| + kWarningBackgroundColorMd : kPageActionBackgroundColorMd; |
|
Peter Kasting
2015/09/02 21:46:10
Should we be getting these colors from the theme p
Evan Stade
2015/09/02 23:34:35
I don't see any other places where this is used in
|
| + } |
| + |
| static const SkColor kWarningBackgroundColorTop = |
| SkColorSetRGB(255, 242, 183); // Yellow |
| static const SkColor kPageActionBackgroundColorTop = |
| @@ -45,6 +59,10 @@ SkColor InfoBar::GetTopColor(InfoBarDelegate::Type infobar_type) { |
| // static |
| SkColor InfoBar::GetBottomColor(InfoBarDelegate::Type infobar_type) { |
| + // No gradient in MD. |
| + if (ui::MaterialDesignController::IsModeMaterial()) |
| + return GetTopColor(infobar_type); |
| + |
| static const SkColor kWarningBackgroundColorBottom = |
| SkColorSetRGB(250, 230, 145); // Yellow |
| static const SkColor kPageActionBackgroundColorBottom = |