Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: components/infobars/core/infobar.cc

Issue 1330513002: Infobar material design refresh: bg color (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more localler Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/infobars/core/infobar.cc
diff --git a/components/infobars/core/infobar.cc b/components/infobars/core/infobar.cc
index 29c1995a960a2955af6ea3879fab63841f8cb6ab..cd8aac4625883438cf5c9847531cef6b493067fd 100644
--- a/components/infobars/core/infobar.cc
+++ b/components/infobars/core/infobar.cc
@@ -10,6 +10,7 @@
#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 {
@@ -35,6 +36,15 @@ InfoBar::~InfoBar() {
// static
SkColor InfoBar::GetTopColor(InfoBarDelegate::Type infobar_type) {
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ static const SkColor kWarningBackgroundColorMd =
+ SkColorSetRGB(0xFF, 0xEC, 0xB3); // Yellow
+ static const SkColor kPageActionBackgroundColorMd = SK_ColorWHITE;
+
+ return infobar_type == InfoBarDelegate::WARNING_TYPE ?
+ kWarningBackgroundColorMd : kPageActionBackgroundColorMd;
+ }
+
static const SkColor kWarningBackgroundColorTop =
SkColorSetRGB(255, 242, 183); // Yellow
static const SkColor kPageActionBackgroundColorTop =
@@ -45,6 +55,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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698