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

Unified Diff: chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc

Issue 602813003: Animate the accessibility focus ring and fix some minor visual issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus_ring_in_chromevox
Patch Set: Correct upstream branch Created 6 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
Index: chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
diff --git a/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc b/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
index b5436bd0ab59431804d0fd79ed3d911b1726df1e..60fb5d8f524455adbe9aa911da4c615c87ad96c5 100644
--- a/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
+++ b/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
@@ -16,7 +16,7 @@ namespace chromeos {
namespace {
// The number of pixels in the color gradient that fades to transparent.
-const int kGradientWidth = 10;
+const int kGradientWidth = 6;
// The color of the focus ring. In the future this might be a parameter.
const int kFocusRingColorRed = 247;
@@ -118,10 +118,11 @@ void AccessibilityFocusRingLayer::OnPaintLayer(gfx::Canvas* canvas) {
paint.setStrokeWidth(2);
SkPath path;
- for (int i = 0; i < kGradientWidth; i++) {
+ int w = kGradientWidth;
xiyuan 2014/09/24 19:40:35 nit: const int w
dmazzoni 2014/09/24 21:40:56 Done.
+ for (int i = 0; i < w; i++) {
xiyuan 2014/09/24 19:40:35 nit: ++i
dmazzoni 2014/09/24 21:40:57 Done.
paint.setColor(
SkColorSetARGBMacro(
- 255 - (255 * i / kGradientWidth),
+ 255 * (w - i) * (w - i) / (w * w),
kFocusRingColorRed, kFocusRingColorGreen, kFocusRingColorBlue));
path = MakePath(ring_, i, offset);
canvas->DrawPath(path, paint);

Powered by Google App Engine
This is Rietveld 408576698