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

Unified Diff: chrome/browser/android/vr_shell/textures/close_button_texture.cc

Issue 2926643003: [VrShell] Centralize color handling and enable close button on fullscreen (Closed)
Patch Set: Created 3 years, 6 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
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..7de21dcfeab9044f6b5c53a59215a5bfdfb7a467 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,11 +19,7 @@ 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;
+constexpr float kIconScaleFactor = 0.5;
} // namespace
@@ -41,8 +38,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
+ : 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 +49,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();
}

Powered by Google App Engine
This is Rietveld 408576698