Chromium Code Reviews| Index: chrome/browser/android/vr_shell/textures/close_button_texture.cc |
| diff --git a/chrome/browser/android/vr_shell/textures/close_button_texture.cc b/chrome/browser/android/vr_shell/textures/close_button_texture.cc |
| index 23bee39e6f9c9680e0ce6dc3bca6f3adf7427d67..12f7f5604d35da48aa286384b4459c1cc27f6e14 100644 |
| --- a/chrome/browser/android/vr_shell/textures/close_button_texture.cc |
| +++ b/chrome/browser/android/vr_shell/textures/close_button_texture.cc |
| @@ -5,6 +5,7 @@ |
| #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" |
| #include "cc/paint/skia_paint_canvas.h" |
| +#include "chrome/browser/android/vr_shell/color_scheme.h" |
| #include "chrome/browser/android/vr_shell/ui_elements/button.h" |
| #include "ui/gfx/canvas.h" |
| #include "ui/gfx/geometry/point_f.h" |
| @@ -18,10 +19,6 @@ namespace vr_shell { |
| namespace { |
| -const SkColor kBackgroundColor = SK_ColorWHITE; |
| -const SkColor kBackgroundColorHover = 0xFFE5E5E5; |
| -const SkColor kBackgroundColorDown = 0xFFD5D5D5; |
| -const SkColor kForegroundColor = 0xFF444444; |
| constexpr float kIconScaleFactor = 0.75; |
| } // namespace |
| @@ -30,6 +27,10 @@ CloseButtonTexture::CloseButtonTexture() = default; |
| CloseButtonTexture::~CloseButtonTexture() = default; |
| +const ColorScheme& CloseButtonTexture::color_scheme() const { |
| + return ColorScheme::GetColorScheme(mode()); |
| +} |
| + |
| void CloseButtonTexture::Draw(SkCanvas* sk_canvas, |
| const gfx::Size& texture_size) { |
| DCHECK_EQ(texture_size.height(), texture_size.width()); |
| @@ -41,8 +42,9 @@ void CloseButtonTexture::Draw(SkCanvas* sk_canvas, |
| size_.set_width(texture_size.width()); |
| cc::PaintFlags flags; |
| - SkColor color = hovered() ? kBackgroundColorHover : kBackgroundColor; |
| - color = pressed() ? kBackgroundColorDown : color; |
| + SkColor color = hovered() ? color_scheme().element_background_hover |
|
cjgrant
2017/05/31 15:39:28
In a ymalik@ CL, another element changed this tern
amp
2017/06/02 01:08:35
I think I saw that but it felt like slightly diffe
|
| + : color_scheme().element_background; |
| + color = pressed() ? color_scheme().element_background_down : color; |
| flags.setColor(color); |
| canvas->DrawCircle(gfx::PointF(size_.width() / 2, size_.height() / 2), |
| size_.width() / 2, flags); |
| @@ -51,7 +53,7 @@ void CloseButtonTexture::Draw(SkCanvas* sk_canvas, |
| canvas->Translate(gfx::Vector2d(size_.height() * (1 - kIconScaleFactor) / 2, |
| size_.height() * (1 - kIconScaleFactor) / 2)); |
| PaintVectorIcon(canvas, ui::kCloseIcon, size_.height() * kIconScaleFactor, |
| - kForegroundColor); |
| + color_scheme().element_foreground); |
| canvas->Restore(); |
| } |