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 #include "chrome/browser/chromeos/ui/accessibility_focus_ring.h" | 5 #include "chrome/browser/chromeos/ui/accessibility_focus_ring.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 | 10 |
9 namespace chromeos { | 11 namespace chromeos { |
10 | 12 |
11 // static | 13 // static |
12 AccessibilityFocusRing AccessibilityFocusRing::CreateWithRect( | 14 AccessibilityFocusRing AccessibilityFocusRing::CreateWithRect( |
13 const gfx::Rect& bounds, int margin) { | 15 const gfx::Rect& bounds, int margin) { |
14 // Compute the height of the top and bottom cap. | 16 // Compute the height of the top and bottom cap. |
15 int cap_height = std::min(bounds.height() / 2, margin * 2); | 17 int cap_height = std::min(bounds.height() / 2, margin * 2); |
16 | 18 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 gfx::Point bottom_right = points[0]; | 135 gfx::Point bottom_right = points[0]; |
134 for (size_t i = 1; i < 36; ++i) { | 136 for (size_t i = 1; i < 36; ++i) { |
135 top_left.SetToMin(points[i]); | 137 top_left.SetToMin(points[i]); |
136 bottom_right.SetToMax(points[i]); | 138 bottom_right.SetToMax(points[i]); |
137 } | 139 } |
138 return gfx::Rect(top_left, gfx::Size(bottom_right.x() - top_left.x(), | 140 return gfx::Rect(top_left, gfx::Size(bottom_right.x() - top_left.x(), |
139 bottom_right.y() - top_left.y())); | 141 bottom_right.y() - top_left.y())); |
140 } | 142 } |
141 | 143 |
142 } // namespace chromeos | 144 } // namespace chromeos |
OLD | NEW |