| 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 | 20 |
| 21 #if defined(OS_MACOSX) && __OBJC__ | 21 #if defined(OS_MACOSX) && __OBJC__ |
| 22 @class BrowserAccessibilityCocoa; | 22 @class BrowserAccessibilityCocoa; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 namespace ui { |
| 26 enum TextBoundaryDirection; |
| 27 } |
| 28 |
| 25 namespace content { | 29 namespace content { |
| 26 class BrowserAccessibilityManager; | 30 class BrowserAccessibilityManager; |
| 27 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 28 class BrowserAccessibilityWin; | 32 class BrowserAccessibilityWin; |
| 29 #endif | 33 #endif |
| 30 | 34 |
| 31 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
| 32 // | 36 // |
| 33 // BrowserAccessibility | 37 // BrowserAccessibility |
| 34 // | 38 // |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 109 |
| 106 // Returns the bounds of the given range in coordinates relative to the | 110 // Returns the bounds of the given range in coordinates relative to the |
| 107 // top-left corner of the overall web area. Only valid when the | 111 // top-left corner of the overall web area. Only valid when the |
| 108 // role is WebAXRoleStaticText. | 112 // role is WebAXRoleStaticText. |
| 109 gfx::Rect GetLocalBoundsForRange(int start, int len) const; | 113 gfx::Rect GetLocalBoundsForRange(int start, int len) const; |
| 110 | 114 |
| 111 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when | 115 // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when |
| 112 // the role is WebAXRoleStaticText. | 116 // the role is WebAXRoleStaticText. |
| 113 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; | 117 gfx::Rect GetGlobalBoundsForRange(int start, int len) const; |
| 114 | 118 |
| 119 // Searches in the given text and from the given offset until the start of |
| 120 // the next or previous word is found and returns its position. |
| 121 int GetWordStartBoundary( |
| 122 int start, ui::TextBoundaryDirection direction) const; |
| 123 |
| 115 // Returns the deepest descendant that contains the specified point | 124 // Returns the deepest descendant that contains the specified point |
| 116 // (in global screen coordinates). | 125 // (in global screen coordinates). |
| 117 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); | 126 BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); |
| 118 | 127 |
| 119 // Marks this object for deletion, releases our reference to it, and | 128 // Marks this object for deletion, releases our reference to it, and |
| 120 // nulls out the pointer to the underlying AXNode. May not delete | 129 // nulls out the pointer to the underlying AXNode. May not delete |
| 121 // the object immediately due to reference counting. | 130 // the object immediately due to reference counting. |
| 122 // | 131 // |
| 123 // Reference counting is used on some platforms because the | 132 // Reference counting is used on some platforms because the |
| 124 // operating system may hold onto a reference to a BrowserAccessibility | 133 // operating system may hold onto a reference to a BrowserAccessibility |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 272 |
| 264 std::string name_; | 273 std::string name_; |
| 265 std::string value_; | 274 std::string value_; |
| 266 | 275 |
| 267 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 276 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 268 }; | 277 }; |
| 269 | 278 |
| 270 } // namespace content | 279 } // namespace content |
| 271 | 280 |
| 272 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 281 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |