OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // AccessibilityFocusRings that surround the rectangles. Adjacent or | 41 // AccessibilityFocusRings that surround the rectangles. Adjacent or |
42 // overlapping rectangles are combined first. This function is protected | 42 // overlapping rectangles are combined first. This function is protected |
43 // so it can be unit-tested. | 43 // so it can be unit-tested. |
44 void RectsToRings(const std::vector<gfx::Rect>& rects, | 44 void RectsToRings(const std::vector<gfx::Rect>& rects, |
45 std::vector<AccessibilityFocusRing>* rings) const; | 45 std::vector<AccessibilityFocusRing>* rings) const; |
46 | 46 |
47 virtual int GetMargin() const; | 47 virtual int GetMargin() const; |
48 | 48 |
49 private: | 49 private: |
50 // FocusRingLayerDelegate. | 50 // FocusRingLayerDelegate. |
51 virtual void OnDeviceScaleFactorChanged() OVERRIDE; | 51 virtual void OnDeviceScaleFactorChanged() override; |
52 | 52 |
53 // CompositorAnimationObserver. | 53 // CompositorAnimationObserver. |
54 virtual void OnAnimationStep(base::TimeTicks timestamp) OVERRIDE; | 54 virtual void OnAnimationStep(base::TimeTicks timestamp) override; |
55 | 55 |
56 void Update(); | 56 void Update(); |
57 | 57 |
58 AccessibilityFocusRing RingFromSortedRects( | 58 AccessibilityFocusRing RingFromSortedRects( |
59 const std::vector<gfx::Rect>& rects) const; | 59 const std::vector<gfx::Rect>& rects) const; |
60 void SplitIntoParagraphShape( | 60 void SplitIntoParagraphShape( |
61 const std::vector<gfx::Rect>& rects, | 61 const std::vector<gfx::Rect>& rects, |
62 gfx::Rect* top, | 62 gfx::Rect* top, |
63 gfx::Rect* middle, | 63 gfx::Rect* middle, |
64 gfx::Rect* bottom) const; | 64 gfx::Rect* bottom) const; |
65 bool Intersects(const gfx::Rect& r1, const gfx::Rect& r2) const; | 65 bool Intersects(const gfx::Rect& r1, const gfx::Rect& r2) const; |
66 | 66 |
67 std::vector<gfx::Rect> rects_; | 67 std::vector<gfx::Rect> rects_; |
68 std::vector<AccessibilityFocusRing> previous_rings_; | 68 std::vector<AccessibilityFocusRing> previous_rings_; |
69 std::vector<AccessibilityFocusRing> rings_; | 69 std::vector<AccessibilityFocusRing> rings_; |
70 std::vector<scoped_ptr<AccessibilityFocusRingLayer> > layers_; | 70 std::vector<scoped_ptr<AccessibilityFocusRingLayer> > layers_; |
71 base::TimeTicks focus_change_time_; | 71 base::TimeTicks focus_change_time_; |
72 ui::Compositor* compositor_; | 72 ui::Compositor* compositor_; |
73 | 73 |
74 friend struct DefaultSingletonTraits<AccessibilityFocusRingController>; | 74 friend struct DefaultSingletonTraits<AccessibilityFocusRingController>; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); | 76 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace chromeos | 79 } // namespace chromeos |
80 | 80 |
81 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
OLD | NEW |