| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // overlapping rectangles are combined first. This function is protected | 61 // overlapping rectangles are combined first. This function is protected |
| 62 // so it can be unit-tested. | 62 // so it can be unit-tested. |
| 63 void RectsToRings(const std::vector<gfx::Rect>& rects, | 63 void RectsToRings(const std::vector<gfx::Rect>& rects, |
| 64 std::vector<AccessibilityFocusRing>* rings) const; | 64 std::vector<AccessibilityFocusRing>* rings) const; |
| 65 | 65 |
| 66 virtual int GetMargin() const; | 66 virtual int GetMargin() const; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, | 69 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 70 CursorWorksOnMultipleDisplays); | 70 CursorWorksOnMultipleDisplays); |
| 71 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 72 CaretRingDrawnOnlyWithinBounds); |
| 71 | 73 |
| 72 // FocusRingLayerDelegate overrides. | 74 // FocusRingLayerDelegate overrides. |
| 73 void OnDeviceScaleFactorChanged() override; | 75 void OnDeviceScaleFactorChanged() override; |
| 74 void OnAnimationStep(base::TimeTicks timestamp) override; | 76 void OnAnimationStep(base::TimeTicks timestamp) override; |
| 75 | 77 |
| 76 void UpdateFocusRingsFromFocusRects(); | 78 void UpdateFocusRingsFromFocusRects(); |
| 77 | 79 |
| 78 void AnimateFocusRings(base::TimeTicks timestamp); | 80 void AnimateFocusRings(base::TimeTicks timestamp); |
| 79 void AnimateCursorRing(base::TimeTicks timestamp); | 81 void AnimateCursorRing(base::TimeTicks timestamp); |
| 80 void AnimateCaretRing(base::TimeTicks timestamp); | 82 void AnimateCaretRing(base::TimeTicks timestamp); |
| 81 | 83 |
| 82 AccessibilityFocusRing RingFromSortedRects( | 84 AccessibilityFocusRing RingFromSortedRects( |
| 83 const std::vector<gfx::Rect>& rects) const; | 85 const std::vector<gfx::Rect>& rects) const; |
| 84 void SplitIntoParagraphShape( | 86 void SplitIntoParagraphShape(const std::vector<gfx::Rect>& rects, |
| 85 const std::vector<gfx::Rect>& rects, | 87 gfx::Rect* top, |
| 86 gfx::Rect* top, | 88 gfx::Rect* middle, |
| 87 gfx::Rect* middle, | 89 gfx::Rect* bottom) const; |
| 88 gfx::Rect* bottom) const; | |
| 89 bool Intersects(const gfx::Rect& r1, const gfx::Rect& r2) const; | 90 bool Intersects(const gfx::Rect& r1, const gfx::Rect& r2) const; |
| 90 | 91 |
| 91 struct LayerAnimationInfo { | 92 struct LayerAnimationInfo { |
| 92 base::TimeTicks start_time; | 93 base::TimeTicks start_time; |
| 93 base::TimeTicks change_time; | 94 base::TimeTicks change_time; |
| 94 base::TimeDelta fade_in_time; | 95 base::TimeDelta fade_in_time; |
| 95 base::TimeDelta fade_out_time; | 96 base::TimeDelta fade_out_time; |
| 96 float opacity = 0; | 97 float opacity = 0; |
| 97 bool smooth = false; | 98 bool smooth = false; |
| 98 }; | 99 }; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 117 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; | 118 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; |
| 118 | 119 |
| 119 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; | 120 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); | 122 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 } // namespace chromeos | 125 } // namespace chromeos |
| 125 | 126 |
| 126 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 127 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
| OLD | NEW |