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

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

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.h
diff --git a/chrome/browser/chromeos/ui/focus_ring_layer.h b/chrome/browser/chromeos/ui/focus_ring_layer.h
index 0b178136ae45d11dc8f49706e7ef430aee0ea9a5..83aa396fe2bd95a15548d9606940f0a1683a99cd 100644
--- a/chrome/browser/chromeos/ui/focus_ring_layer.h
+++ b/chrome/browser/chromeos/ui/focus_ring_layer.h
@@ -8,7 +8,9 @@
#include <memory>
#include "base/macros.h"
+#include "base/optional.h"
#include "base/time/time.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/compositor/compositor_animation_observer.h"
#include "ui/compositor/layer_delegate.h"
#include "ui/gfx/geometry/rect.h"
@@ -52,6 +54,10 @@ class FocusRingLayer : public ui::LayerDelegate,
// Set the layer's opacity.
void SetOpacity(float opacity);
+ // Set a custom color, or reset to the default.
+ void SetColor(SkColor color);
+ void ResetColor();
+
ui::Layer* layer() { return layer_.get(); }
aura::Window* root_window() { return root_window_; }
@@ -63,6 +69,9 @@ class FocusRingLayer : public ui::LayerDelegate,
const char* layer_name,
const gfx::Rect& bounds);
+ bool has_custom_color() { return custom_color_.has_value(); }
+ SkColor custom_color() { return *custom_color_; }
+
private:
// ui::LayerDelegate overrides:
void OnPaintLayer(const ui::PaintContext& context) override;
@@ -77,7 +86,7 @@ class FocusRingLayer : public ui::LayerDelegate,
FocusRingLayerDelegate* delegate_;
// The current root window containing the focused object.
- aura::Window* root_window_;
+ aura::Window* root_window_ = nullptr;
// The current layer.
std::unique_ptr<ui::Layer> layer_;
@@ -86,8 +95,10 @@ class FocusRingLayer : public ui::LayerDelegate,
// coordinates.
gfx::Rect focus_ring_;
+ base::Optional<SkColor> custom_color_;
+
// The compositor associated with this layer.
- ui::Compositor* compositor_;
+ ui::Compositor* compositor_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(FocusRingLayer);
};
« no previous file with comments | « chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc ('k') | chrome/browser/chromeos/ui/focus_ring_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698