| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // platform. | 123 // platform. |
| 124 bool PlatformIsChildOfLeaf() const; | 124 bool PlatformIsChildOfLeaf() const; |
| 125 | 125 |
| 126 // If this object is exposed to the platform, returns this object. Otherwise, | 126 // If this object is exposed to the platform, returns this object. Otherwise, |
| 127 // returns the platform leaf under which this object is found. | 127 // returns the platform leaf under which this object is found. |
| 128 BrowserAccessibility* GetClosestPlatformObject() const; | 128 BrowserAccessibility* GetClosestPlatformObject() const; |
| 129 | 129 |
| 130 BrowserAccessibility* GetPreviousSibling() const; | 130 BrowserAccessibility* GetPreviousSibling() const; |
| 131 BrowserAccessibility* GetNextSibling() const; | 131 BrowserAccessibility* GetNextSibling() const; |
| 132 | 132 |
| 133 bool IsPreviousSiblingOnSameLine() const; |
| 134 bool IsNextSiblingOnSameLine() const; |
| 135 |
| 133 // Returns nullptr if there are no children. | 136 // Returns nullptr if there are no children. |
| 134 BrowserAccessibility* PlatformDeepestFirstChild() const; | 137 BrowserAccessibility* PlatformDeepestFirstChild() const; |
| 135 // Returns nullptr if there are no children. | 138 // Returns nullptr if there are no children. |
| 136 BrowserAccessibility* PlatformDeepestLastChild() const; | 139 BrowserAccessibility* PlatformDeepestLastChild() const; |
| 137 | 140 |
| 138 // Returns nullptr if there are no children. | 141 // Returns nullptr if there are no children. |
| 139 BrowserAccessibility* InternalDeepestFirstChild() const; | 142 BrowserAccessibility* InternalDeepestFirstChild() const; |
| 140 // Returns nullptr if there are no children. | 143 // Returns nullptr if there are no children. |
| 141 BrowserAccessibility* InternalDeepestLastChild() const; | 144 BrowserAccessibility* InternalDeepestLastChild() const; |
| 142 | 145 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 153 gfx::Rect GetLocalBoundsForRange(int start, int len) const; | 156 gfx::Rect GetLocalBoundsForRange(int start, int len) const; |
| 154 | 157 |
| 155 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when | 158 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when |
| 156 // the role is WebAXRoleStaticText. | 159 // the role is WebAXRoleStaticText. |
| 157 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; | 160 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; |
| 158 | 161 |
| 159 // This is to handle the cases such as ARIA textbox, where the value should | 162 // This is to handle the cases such as ARIA textbox, where the value should |
| 160 // be calculated from the object's inner text. | 163 // be calculated from the object's inner text. |
| 161 virtual base::string16 GetValue() const; | 164 virtual base::string16 GetValue() const; |
| 162 | 165 |
| 163 // Searches in the given text and from the given offset until the start of | 166 // Starting at the given character offset, locates the start of the next or |
| 164 // the next or previous word is found and returns its position. | 167 // previous line and returns its character offset. |
| 168 int GetLineStartBoundary(int start, |
| 169 ui::TextBoundaryDirection direction) const; |
| 170 |
| 171 // Starting at the given character offset, locates the start of the next or |
| 172 // previous word and returns its character offset. |
| 165 // In case there is no word boundary before or after the given offset, it | 173 // In case there is no word boundary before or after the given offset, it |
| 166 // returns one past the last character, i.e. the text's length. | 174 // returns one past the last character. |
| 167 // If the given offset is already at the start of a word, returns the start | 175 // If the given offset is already at the start of a word, returns the start |
| 168 // of the next word if the search is forwards and the given offset if it is | 176 // of the next word if the search is forwards, and the given offset if it is |
| 169 // backwards. | 177 // backwards. |
| 170 // If the start offset is equal to -1 and the search is in the forwards | 178 // If the start offset is equal to -1 and the search is in the forwards |
| 171 // direction, returns the start boundary of the first word. | 179 // direction, returns the start boundary of the first word. |
| 172 // Start offsets that are not in the range -1 to text length are invalid. | 180 // Start offsets that are not in the range -1 to text length are invalid. |
| 173 int GetWordStartBoundary( | 181 int GetWordStartBoundary(int start, |
| 174 int start, ui::TextBoundaryDirection direction) const; | 182 ui::TextBoundaryDirection direction) const; |
| 175 | 183 |
| 176 // Returns the deepest descendant that contains the specified point | 184 // Returns the deepest descendant that contains the specified point |
| 177 // (in global screen coordinates). | 185 // (in global screen coordinates). |
| 178 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); | 186 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); |
| 179 | 187 |
| 180 // Marks this object for deletion, releases our reference to it, and | 188 // Marks this object for deletion, releases our reference to it, and |
| 181 // nulls out the pointer to the underlying AXNode. May not delete | 189 // nulls out the pointer to the underlying AXNode. May not delete |
| 182 // the object immediately due to reference counting. | 190 // the object immediately due to reference counting. |
| 183 // | 191 // |
| 184 // Reference counting is used on some platforms because the | 192 // Reference counting is used on some platforms because the |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // its nearest scrollable ancestor) to local bounds (which are relative | 369 // its nearest scrollable ancestor) to local bounds (which are relative |
| 362 // to the top of the web accessibility tree). | 370 // to the top of the web accessibility tree). |
| 363 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; | 371 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; |
| 364 | 372 |
| 365 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 373 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 366 }; | 374 }; |
| 367 | 375 |
| 368 } // namespace content | 376 } // namespace content |
| 369 | 377 |
| 370 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 378 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |