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

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

Issue 537893003: Move view logic from FocusRingLayer to FocusRingController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus_ring_0_force_on
Patch Set: Address nits 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
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_controller.cc ('k') | chrome/browser/chromeos/ui/focus_ring_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1dbb93538273aa056543aa930f4a930f6354615e..478b7cc2ec96a51e23d2589097cae60f336bb011 100644
--- a/chrome/browser/chromeos/ui/focus_ring_layer.h
+++ b/chrome/browser/chromeos/ui/focus_ring_layer.h
@@ -18,23 +18,26 @@ namespace ui {
class Layer;
}
-namespace views {
-class View;
-}
-
namespace chromeos {
-// FocusRingLayer draws a focus ring for a given view.
+// A delegate interface implemented by the object that owns a FocusRingLayer.
+class FocusRingLayerDelegate {
+ public:
+ virtual void OnDeviceScaleFactorChanged() = 0;
+
+ protected:
+ virtual ~FocusRingLayerDelegate();
+};
+
+// FocusRingLayer draws a focus ring at a given global rectangle.
class FocusRingLayer : public ui::LayerDelegate {
public:
- FocusRingLayer();
+ explicit FocusRingLayer(FocusRingLayerDelegate* delegate);
virtual ~FocusRingLayer();
- // Create the layer and update its bounds and position in the hierarchy.
- void Update();
-
- // Updates the focus ring layer for the view or clears it if |view| is NULL.
- void SetForView(views::View* view);
+ // Move the focus ring layer to the given bounds in the coordinates of
+ // the given root window.
+ void Set(aura::Window* root_window, const gfx::Rect& bounds);
private:
// ui::LayerDelegate overrides:
@@ -44,13 +47,14 @@ class FocusRingLayer : public ui::LayerDelegate {
virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
- // The window containing focus.
- aura::Window* window_;
+ // The object that owns this layer.
+ FocusRingLayerDelegate* delegate_;
// The current root window containing the focused object.
aura::Window* root_window_;
- // The bounding rectangle of the focused object, in |window_| coordinates.
+ // The bounding rectangle of the focused object, in |root_window_|
+ // coordinates.
gfx::Rect focus_ring_;
// The current layer.
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_controller.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