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

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

Issue 2789583004: Add a color argument to accessibilityPrivate.setFocusRing (Closed)
Patch Set: Rebase Created 3 years, 9 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/focus_ring_layer.cc
diff --git a/chrome/browser/chromeos/ui/focus_ring_layer.cc b/chrome/browser/chromeos/ui/focus_ring_layer.cc
index f988578bc2182556391068b0a2aa3df748e5b287..a9754af952be94e57f6855a990fdc413290db871 100644
--- a/chrome/browser/chromeos/ui/focus_ring_layer.cc
+++ b/chrome/browser/chromeos/ui/focus_ring_layer.cc
@@ -29,7 +29,7 @@ const SkColor kShadowColor = SkColorSetRGB(77, 144, 254);
FocusRingLayerDelegate::~FocusRingLayerDelegate() {}
FocusRingLayer::FocusRingLayer(FocusRingLayerDelegate* delegate)
- : delegate_(delegate), root_window_(nullptr), compositor_(nullptr) {}
+ : delegate_(delegate) {}
FocusRingLayer::~FocusRingLayer() {
if (compositor_ && compositor_->HasAnimationObserver(this))
@@ -52,6 +52,14 @@ void FocusRingLayer::SetOpacity(float opacity) {
layer()->SetOpacity(opacity);
}
+void FocusRingLayer::SetColor(SkColor color) {
+ custom_color_ = color;
+}
+
+void FocusRingLayer::ResetColor() {
+ custom_color_.reset();
+}
+
void FocusRingLayer::CreateOrUpdateLayer(aura::Window* root_window,
const char* layer_name,
const gfx::Rect& bounds) {
@@ -92,7 +100,7 @@ void FocusRingLayer::OnPaintLayer(const ui::PaintContext& context) {
cc::PaintFlags flags;
flags.setAntiAlias(true);
- flags.setColor(kShadowColor);
+ flags.setColor(custom_color_ ? *custom_color_ : kShadowColor);
flags.setStyle(cc::PaintFlags::kStroke_Style);
flags.setStrokeWidth(2);
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_layer.h ('k') | chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698