| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 private: | 276 private: |
| 277 // Return the sum of the lengths of all static text descendants, | 277 // Return the sum of the lengths of all static text descendants, |
| 278 // including this object if it's static text. | 278 // including this object if it's static text. |
| 279 int GetStaticTextLenRecursive() const; | 279 int GetStaticTextLenRecursive() const; |
| 280 | 280 |
| 281 // Similar to GetParent(), but includes nodes that are the host of a | 281 // Similar to GetParent(), but includes nodes that are the host of a |
| 282 // subtree rather than skipping over them - because they contain important | 282 // subtree rather than skipping over them - because they contain important |
| 283 // bounds offsets. | 283 // bounds offsets. |
| 284 BrowserAccessibility* GetParentForBoundsCalculation() const; | 284 BrowserAccessibility* GetParentForBoundsCalculation() const; |
| 285 | 285 |
| 286 // If a bounding rectangle is empty, compute it based on the union of its |
| 287 // children, since most accessibility APIs don't like elements with no |
| 288 // bounds, but "virtual" elements in the accessibility tree that don't |
| 289 // correspond to a layed-out element sometimes don't have bounds. |
| 290 void FixEmptyBounds(gfx::Rect* bounds) const; |
| 291 |
| 286 // Convert the bounding rectangle of an element (which is relative to | 292 // Convert the bounding rectangle of an element (which is relative to |
| 287 // its nearest scrollable ancestor) to local bounds (which are relative | 293 // its nearest scrollable ancestor) to local bounds (which are relative |
| 288 // to the top of the web accessibility tree). | 294 // to the top of the web accessibility tree). |
| 289 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; | 295 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; |
| 290 | 296 |
| 291 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 297 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 292 }; | 298 }; |
| 293 | 299 |
| 294 } // namespace content | 300 } // namespace content |
| 295 | 301 |
| 296 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 302 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |