| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Get the single instance of this class. | 24 // Get the single instance of this class. |
| 25 static AccessibilityFocusRingController* GetInstance(); | 25 static AccessibilityFocusRingController* GetInstance(); |
| 26 | 26 |
| 27 enum FocusRingBehavior { FADE_OUT_FOCUS_RING, PERSIST_FOCUS_RING }; | 27 enum FocusRingBehavior { FADE_OUT_FOCUS_RING, PERSIST_FOCUS_RING }; |
| 28 | 28 |
| 29 // Draw a focus ring around the given set of rects, in global screen | 29 // Draw a focus ring around the given set of rects, in global screen |
| 30 // coordinates. Use |focus_ring_behavior| to specify whether the focus | 30 // coordinates. Use |focus_ring_behavior| to specify whether the focus |
| 31 // ring should persist or fade out. | 31 // ring should persist or fade out. |
| 32 void SetFocusRing(const std::vector<gfx::Rect>& rects, | 32 void SetFocusRing(const std::vector<gfx::Rect>& rects, |
| 33 FocusRingBehavior focus_ring_behavior); | 33 FocusRingBehavior focus_ring_behavior); |
| 34 void HideFocusRing(); |
| 34 | 35 |
| 35 // Draw a ring around the mouse cursor. It fades out automatically. | 36 // Draw a ring around the mouse cursor. It fades out automatically. |
| 36 void SetCursorRing(const gfx::Point& location); | 37 void SetCursorRing(const gfx::Point& location); |
| 38 void HideCursorRing(); |
| 37 | 39 |
| 38 // Draw a ring around the text caret. It fades out automatically. | 40 // Draw a ring around the text caret. It fades out automatically. |
| 39 void SetCaretRing(const gfx::Point& location); | 41 void SetCaretRing(const gfx::Point& location); |
| 42 void HideCaretRing(); |
| 40 | 43 |
| 41 // Don't fade in / out, for testing. | 44 // Don't fade in / out, for testing. |
| 42 void SetNoFadeForTesting(); | 45 void SetNoFadeForTesting(); |
| 43 | 46 |
| 44 protected: | 47 protected: |
| 45 AccessibilityFocusRingController(); | 48 AccessibilityFocusRingController(); |
| 46 ~AccessibilityFocusRingController() override; | 49 ~AccessibilityFocusRingController() override; |
| 47 | 50 |
| 48 // Given an unordered vector of bounding rectangles that cover everything | 51 // Given an unordered vector of bounding rectangles that cover everything |
| 49 // that currently has focus, populate a vector of one or more | 52 // that currently has focus, populate a vector of one or more |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; | 106 std::unique_ptr<AccessibilityCursorRingLayer> caret_layer_; |
| 104 | 107 |
| 105 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; | 108 friend struct base::DefaultSingletonTraits<AccessibilityFocusRingController>; |
| 106 | 109 |
| 107 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); | 110 DISALLOW_COPY_AND_ASSIGN(AccessibilityFocusRingController); |
| 108 }; | 111 }; |
| 109 | 112 |
| 110 } // namespace chromeos | 113 } // namespace chromeos |
| 111 | 114 |
| 112 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ | 115 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_CONTROLLER_H_ |
| OLD | NEW |