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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "third_party/WebKit/public/web/WebAXEnums.h" | 17 #include "third_party/WebKit/public/web/WebAXEnums.h" |
18 #include "ui/accessibility/ax_node.h" | 18 #include "ui/accessibility/ax_node.h" |
19 #include "ui/accessibility/ax_node_data.h" | 19 #include "ui/accessibility/ax_node_data.h" |
| 20 #include "ui/accessibility/ax_text_utils.h" |
20 | 21 |
21 #if defined(OS_MACOSX) && __OBJC__ | 22 #if defined(OS_MACOSX) && __OBJC__ |
22 @class BrowserAccessibilityCocoa; | 23 @class BrowserAccessibilityCocoa; |
23 #endif | 24 #endif |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 class BrowserAccessibilityManager; | 27 class BrowserAccessibilityManager; |
27 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
28 class BrowserAccessibilityWin; | 29 class BrowserAccessibilityWin; |
29 #endif | 30 #endif |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 // Returns the bounds of the given range in coordinates relative to the | 106 // Returns the bounds of the given range in coordinates relative to the |
106 // top-left corner of the overall web area. Only valid when the | 107 // top-left corner of the overall web area. Only valid when the |
107 // role is WebAXRoleStaticText. | 108 // role is WebAXRoleStaticText. |
108 gfx::Rect GetLocalBoundsForRange(int start, int len) const; | 109 gfx::Rect GetLocalBoundsForRange(int start, int len) const; |
109 | 110 |
110 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when | 111 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when |
111 // the role is WebAXRoleStaticText. | 112 // the role is WebAXRoleStaticText. |
112 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; | 113 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; |
113 | 114 |
| 115 // Searches in the given text and from the given offset until the start of |
| 116 // the next or previous word is found and returns its position. |
| 117 int GetWordStartBoundary( |
| 118 int start, ui::TextBoundaryDirection direction) const; |
| 119 |
114 // Returns the deepest descendant that contains the specified point | 120 // Returns the deepest descendant that contains the specified point |
115 // (in global screen coordinates). | 121 // (in global screen coordinates). |
116 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); | 122 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); |
117 | 123 |
118 // Marks this object for deletion, releases our reference to it, and | 124 // Marks this object for deletion, releases our reference to it, and |
119 // nulls out the pointer to the underlying AXNode. May not delete | 125 // nulls out the pointer to the underlying AXNode. May not delete |
120 // the object immediately due to reference counting. | 126 // the object immediately due to reference counting. |
121 // | 127 // |
122 // Reference counting is used on some platforms because the | 128 // Reference counting is used on some platforms because the |
123 // operating system may hold onto a reference to a BrowserAccessibility | 129 // operating system may hold onto a reference to a BrowserAccessibility |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // its nearest scrollable ancestor) to local bounds (which are relative | 277 // its nearest scrollable ancestor) to local bounds (which are relative |
272 // to the top of the web accessibility tree). | 278 // to the top of the web accessibility tree). |
273 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; | 279 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; |
274 | 280 |
275 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 281 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
276 }; | 282 }; |
277 | 283 |
278 } // namespace content | 284 } // namespace content |
279 | 285 |
280 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 286 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |