Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / ui / focus_ring_layer.h
blobba83535bd51c14a429a7b1799317025ac73d972c
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_LAYER_H_
6 #define CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_LAYER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/compositor/layer_delegate.h"
11 #include "ui/gfx/rect.h"
13 namespace aura {
14 class Window;
17 namespace ui {
18 class Layer;
21 namespace views {
22 class View;
25 namespace chromeos {
27 // FocusRingLayer draws a focus ring for a given view.
28 class FocusRingLayer : public ui::LayerDelegate {
29 public:
30 FocusRingLayer();
31 virtual ~FocusRingLayer();
33 // Create the layer and update its bounds and position in the hierarchy.
34 void Update();
36 // Updates the focus ring layer for the view or clears it if |view| is NULL.
37 void SetForView(views::View* view);
39 private:
40 // ui::LayerDelegate overrides:
41 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
42 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
43 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE;
45 // The window containing focus.
46 aura::Window* window_;
48 // The current root window containing the focused object.
49 aura::Window* root_window_;
51 // The bounding rectangle of the focused object, in |window_| coordinates.
52 gfx::Rect focus_ring_;
54 // The current layer.
55 scoped_ptr<ui::Layer> layer_;
57 DISALLOW_COPY_AND_ASSIGN(FocusRingLayer);
60 } // namespace chromeos
62 #endif // CHROME_BROWSER_CHROMEOS_UI_FOCUS_RING_LAYER_H_