| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 14 #include "chrome/browser/chromeos/ui/accessibility_cursor_ring_layer.h" | 15 #include "chrome/browser/chromeos/ui/accessibility_cursor_ring_layer.h" |
| 15 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_layer.h" | 16 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_layer.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // that currently has focus, populate a vector of one or more | 53 // that currently has focus, populate a vector of one or more |
| 53 // AccessibilityFocusRings that surround the rectangles. Adjacent or | 54 // AccessibilityFocusRings that surround the rectangles. Adjacent or |
| 54 // overlapping rectangles are combined first. This function is protected | 55 // overlapping rectangles are combined first. This function is protected |
| 55 // so it can be unit-tested. | 56 // so it can be unit-tested. |
| 56 void RectsToRings(const std::vector<gfx::Rect>& rects, | 57 void RectsToRings(const std::vector<gfx::Rect>& rects, |
| 57 std::vector<AccessibilityFocusRing>* rings) const; | 58 std::vector<AccessibilityFocusRing>* rings) const; |
| 58 | 59 |
| 59 virtual int GetMargin() const; | 60 virtual int GetMargin() const; |
| 60 | 61 |
| 61 private: | 62 private: |
| 63 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 64 CursorWorksOnMultipleDisplays); |
| 65 |
| 62 // FocusRingLayerDelegate overrides. | 66 // FocusRingLayerDelegate overrides. |
| 63 void OnDeviceScaleFactorChanged() override; | 67 void OnDeviceScaleFactorChanged() override; |
| 64 void OnAnimationStep(base::TimeTicks timestamp) override; | 68 void OnAnimationStep(base::TimeTicks timestamp) override; |
| 65 | 69 |
| 66 void UpdateFocusRingsFromFocusRects(); | 70 void UpdateFocusRingsFromFocusRects(); |
| 67 | 71 |
| 68 void AnimateFocusRings(base::TimeTicks timestamp); | 72 void AnimateFocusRings(base::TimeTicks timestamp); |
| 69 void AnimateCursorRing(base::TimeTicks timestamp); | 73 void AnimateCursorRing(base::TimeTicks timestamp); |
| 70 void AnimateCaretRing(base::TimeTicks timestamp); | 74 void AnimateCaretRing(base::TimeTicks timestamp); |
| 71 | 75 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; | 110 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; |
| 107 | 111 |
| 108 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; | 112 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; |
| 109 | 113 |
| 110 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); | 114 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace chromeos | 117 } // namespace chromeos |
| 114 | 118 |
| 115 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 119 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
| OLD | NEW |