| 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/point.h" | 8 #include "ui/gfx/point.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // The same path should be used even if the focus ring was initialized with | 37 // The same path should be used even if the focus ring was initialized with |
| 38 // a rectangle and not a paragraph shape - this makes it possible to | 38 // a rectangle and not a paragraph shape - this makes it possible to |
| 39 // smoothly animate between one object and the next simply by interpolating | 39 // smoothly animate between one object and the next simply by interpolating |
| 40 // points. | 40 // points. |
| 41 // | 41 // |
| 42 // Noncontiguous shapes should be handled by drawing multiple focus rings. | 42 // Noncontiguous shapes should be handled by drawing multiple focus rings. |
| 43 // | 43 // |
| 44 // The 36 points are defined as follows: | 44 // The 36 points are defined as follows: |
| 45 // | 45 // |
| 46 // 2 3------------------------------4 5 | 46 // 2 3------------------------------4 5 |
| 47 // / \ | 47 // / | |
| 48 // 1 6 | 48 // 1 6 |
| 49 // | First line of paragraph | | 49 // | First line of paragraph | |
| 50 // 0 7 | 50 // 0 7 |
| 51 // / \ | 51 // / | |
| 52 // 32 33-34 35 8 9---------------10 11 | 52 // 32 33-34 35 8 9---------------10 11 |
| 53 // / \ | 53 // / | |
| 54 // 31 Middle line of paragraph.......................... 12 | 54 // 31 Middle line of paragraph.......................... 12 |
| 55 // | | | 55 // | | |
| 56 // | | | 56 // | | |
| 57 // | Middle line of paragraph.......................... | | 57 // | Middle line of paragraph.......................... | |
| 58 // | | | 58 // | | |
| 59 // | | | 59 // | | |
| 60 // 30 Middle line of paragraph.......................... 13 | 60 // 30 Middle line of paragraph.......................... 13 |
| 61 // \ / | 61 // | | |
| 62 // 29 28---------27 26 17 16---------15 14 | 62 // 29 28---------27 26 17 16---------15 14 |
| 63 // \ / | 63 // | | |
| 64 // 25 18 | 64 // 25 18 |
| 65 // | Last line of paragraph | | 65 // | Last line of paragraph | |
| 66 // 24 19 | 66 // 24 19 |
| 67 // \ / | 67 // | | |
| 68 // 23 22-----------------------21 20 | 68 // 23 22-----------------------21 20 |
| 69 | 69 |
| 70 struct AccessibilityFocusRing { | 70 struct AccessibilityFocusRing { |
| 71 // Construct an AccessibilityFocusRing that outlines a rectangular object. | 71 // Construct an AccessibilityFocusRing that outlines a rectangular object. |
| 72 static AccessibilityFocusRing CreateWithRect( | 72 static AccessibilityFocusRing CreateWithRect( |
| 73 const gfx::Rect& bounds, int margin); | 73 const gfx::Rect& bounds, int margin); |
| 74 | 74 |
| 75 // Construct an AccessibilityFocusRing that outlines a paragraph-shaped | 75 // Construct an AccessibilityFocusRing that outlines a paragraph-shaped |
| 76 // object. | 76 // object. |
| 77 static AccessibilityFocusRing CreateWithParagraphShape( | 77 static AccessibilityFocusRing CreateWithParagraphShape( |
| 78 const gfx::Rect& top_line, | 78 const gfx::Rect& top_line, |
| 79 const gfx::Rect& body, | 79 const gfx::Rect& body, |
| 80 const gfx::Rect& bottom_line, | 80 const gfx::Rect& bottom_line, |
| 81 int margin); | 81 int margin); |
| 82 | 82 |
| 83 gfx::Point points[36]; | 83 gfx::Point points[36]; |
| 84 gfx::Rect GetBounds() const; | 84 gfx::Rect GetBounds() const; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace chromeos | 87 } // namespace chromeos |
| 88 | 88 |
| 89 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_UI_ACCESSIBILITY_FOCUS_RING_H_ |
| OLD | NEW |