Chromium Code Reviews| 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..14753370063d7bd41776fea9cc987936922bcd33 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,8 +47,11 @@ 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_; |
| + // Create the layer and update its bounds and position in the hierarchy. |
| + void Update(); |
|
xiyuan
2014/09/10 23:03:16
This is gone, right?
dmazzoni
2014/09/11 18:31:50
Done.
|
| + |
| + // The object that owns this layer. |
| + FocusRingLayerDelegate* delegate_; |
| // The current root window containing the focused object. |
| aura::Window* root_window_; |