| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // Returns the bounds of the given range in coordinates relative to the | 156 // Returns the bounds of the given range in coordinates relative to the |
| 157 // top-left corner of the overall web area. Only valid when the | 157 // top-left corner of the overall web area. Only valid when the |
| 158 // role is WebAXRoleStaticText. | 158 // role is WebAXRoleStaticText. |
| 159 gfx::Rect GetPageBoundsForRange(int start, int len) const; | 159 gfx::Rect GetPageBoundsForRange(int start, int len) const; |
| 160 | 160 |
| 161 // Same as GetPageBoundsForRange, in screen coordinates. Only valid when | 161 // Same as GetPageBoundsForRange, in screen coordinates. Only valid when |
| 162 // the role is WebAXRoleStaticText. | 162 // the role is WebAXRoleStaticText. |
| 163 gfx::Rect GetScreenBoundsForRange(int start, int len) const; | 163 gfx::Rect GetScreenBoundsForRange(int start, int len) const; |
| 164 | 164 |
| 165 // Convert a bounding rectangle from this node's coordinate system |
| 166 // (which is relative to its nearest scrollable ancestor) to |
| 167 // absolute bounds, either in page coordinates (when |frameOnly| is |
| 168 // false), or in frame coordinates (when |frameOnly| is true). |
| 169 gfx::Rect RelativeToAbsoluteBounds(gfx::RectF bounds, bool frame_only) const; |
| 170 |
| 165 // This is to handle the cases such as ARIA textbox, where the value should | 171 // This is to handle the cases such as ARIA textbox, where the value should |
| 166 // be calculated from the object's inner text. | 172 // be calculated from the object's inner text. |
| 167 virtual base::string16 GetValue() const; | 173 virtual base::string16 GetValue() const; |
| 168 | 174 |
| 169 // Starting at the given character offset, locates the start of the next or | 175 // Starting at the given character offset, locates the start of the next or |
| 170 // previous line and returns its character offset. | 176 // previous line and returns its character offset. |
| 171 int GetLineStartBoundary(int start, | 177 int GetLineStartBoundary(int start, |
| 172 ui::TextBoundaryDirection direction, | 178 ui::TextBoundaryDirection direction, |
| 173 ui::AXTextAffinity affinity) const; | 179 ui::AXTextAffinity affinity) const; |
| 174 | 180 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 // special character in the place of every embedded object instead of its | 375 // special character in the place of every embedded object instead of its |
| 370 // text, depending on the platform. | 376 // text, depending on the platform. |
| 371 base::string16 GetInnerText() const; | 377 base::string16 GetInnerText() const; |
| 372 | 378 |
| 373 // If a bounding rectangle is empty, compute it based on the union of its | 379 // If a bounding rectangle is empty, compute it based on the union of its |
| 374 // children, since most accessibility APIs don't like elements with no | 380 // children, since most accessibility APIs don't like elements with no |
| 375 // bounds, but "virtual" elements in the accessibility tree that don't | 381 // bounds, but "virtual" elements in the accessibility tree that don't |
| 376 // correspond to a layed-out element sometimes don't have bounds. | 382 // correspond to a layed-out element sometimes don't have bounds. |
| 377 void FixEmptyBounds(gfx::RectF* bounds) const; | 383 void FixEmptyBounds(gfx::RectF* bounds) const; |
| 378 | 384 |
| 379 // Convert the bounding rectangle of an element (which is relative to | |
| 380 // its nearest scrollable ancestor) to absolute bounds, either in | |
| 381 // page coordinates (when |frameOnly| is false), or in frame coordinates | |
| 382 // (when |frameOnly| is true). | |
| 383 gfx::Rect RelativeToAbsoluteBounds(gfx::RectF bounds, bool frame_only) const; | |
| 384 | |
| 385 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 385 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace content | 388 } // namespace content |
| 389 | 389 |
| 390 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 390 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |