[email protected] | eaf8a342 | 2012-01-24 23:35:31 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| 6 | #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 7 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 8 | #include <map> |
| 9 | #include <utility> |
| 10 | #include <vector> |
| 11 | |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 12 | #include "base/basictypes.h" |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 13 | #include "base/strings/string16.h" |
mohan.reddy | 0079fba | 2014-09-25 07:25:23 | [diff] [blame] | 14 | #include "base/strings/string_split.h" |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 15 | #include "build/build_config.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 16 | #include "content/common/content_export.h" |
[email protected] | 10760e4a | 2013-09-04 23:32:20 | [diff] [blame] | 17 | #include "third_party/WebKit/public/web/WebAXEnums.h" |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 18 | #include "ui/accessibility/ax_node.h" |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 19 | #include "ui/accessibility/ax_node_data.h" |
nektar | 6baff46f | 2015-02-25 06:22:35 | [diff] [blame] | 20 | #include "ui/accessibility/ax_text_utils.h" |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 21 | |
[email protected] | 95b3f544 | 2012-05-06 17:10:07 | [diff] [blame] | 22 | #if defined(OS_MACOSX) && __OBJC__ |
| 23 | @class BrowserAccessibilityCocoa; |
[email protected] | e6b3487 | 2012-10-24 20:51:32 | [diff] [blame] | 24 | #endif |
| 25 | |
| 26 | namespace content { |
| 27 | class BrowserAccessibilityManager; |
| 28 | #if defined(OS_WIN) |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 29 | class BrowserAccessibilityWin; |
| 30 | #endif |
| 31 | |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 32 | //////////////////////////////////////////////////////////////////////////////// |
| 33 | // |
| 34 | // BrowserAccessibility |
| 35 | // |
dmazzoni | 0b5d248 | 2014-09-10 19:45:57 | [diff] [blame] | 36 | // A BrowserAccessibility object represents one node in the accessibility |
| 37 | // tree on the browser side. It exactly corresponds to one WebAXObject from |
| 38 | // Blink. It's owned by a BrowserAccessibilityManager. |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 39 | // |
dmazzoni | 0b5d248 | 2014-09-10 19:45:57 | [diff] [blame] | 40 | // There are subclasses of BrowserAccessibility for each platform where |
| 41 | // we implement native accessibility APIs. This base class is used occasionally |
| 42 | // for tests. |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 43 | // |
| 44 | //////////////////////////////////////////////////////////////////////////////// |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 45 | class CONTENT_EXPORT BrowserAccessibility { |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 46 | public: |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 47 | // Creates a platform specific BrowserAccessibility. Ownership passes to the |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 48 | // caller. |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 49 | static BrowserAccessibility* Create(); |
| 50 | |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 51 | virtual ~BrowserAccessibility(); |
| 52 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 53 | // Called only once, immediately after construction. The constructor doesn't |
| 54 | // take any arguments because in the Windows subclass we use a special |
| 55 | // function to construct a COM object. |
| 56 | virtual void Init(BrowserAccessibilityManager* manager, ui::AXNode* node); |
[email protected] | b05cd54 | 2011-06-08 01:38:02 | [diff] [blame] | 57 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 58 | // Called after the object is first initialized and again every time |
| 59 | // its data changes. |
dmazzoni | 9b381f3 | 2015-01-27 00:34:08 | [diff] [blame] | 60 | virtual void OnDataChanged() {} |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 61 | |
dmazzoni | 9b381f3 | 2015-01-27 00:34:08 | [diff] [blame] | 62 | virtual void OnSubtreeWillBeDeleted() {} |
| 63 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 64 | // Called when the location changed. |
dmazzoni | 487bac0 | 2014-08-27 20:54:11 | [diff] [blame] | 65 | virtual void OnLocationChanged() {} |
[email protected] | a10a5f8 | 2013-05-06 05:24:56 | [diff] [blame] | 66 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 67 | // Return true if this object is equal to or a descendant of |ancestor|. |
| 68 | bool IsDescendantOf(BrowserAccessibility* ancestor); |
| 69 | |
[email protected] | 933af8c | 2013-11-01 17:59:40 | [diff] [blame] | 70 | // Returns true if this is a leaf node on this platform, meaning any |
| 71 | // children should not be exposed to this platform's native accessibility |
| 72 | // layer. Each platform subclass should implement this itself. |
| 73 | // The definition of a leaf may vary depending on the platform, |
| 74 | // but a leaf node should never have children that are focusable or |
| 75 | // that might send notifications. |
| 76 | virtual bool PlatformIsLeaf() const; |
| 77 | |
| 78 | // Returns the number of children of this object, or 0 if PlatformIsLeaf() |
| 79 | // returns true. |
| 80 | uint32 PlatformChildCount() const; |
| 81 | |
| 82 | // Return a pointer to the child at the given index, or NULL for an |
| 83 | // invalid index. Returns NULL if PlatformIsLeaf() returns true. |
| 84 | BrowserAccessibility* PlatformGetChild(uint32 child_index) const; |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 85 | |
dmazzoni | 9b381f3 | 2015-01-27 00:34:08 | [diff] [blame] | 86 | // Returns true if an ancestor of this node (not including itself) is a |
| 87 | // leaf node, meaning that this node is not actually exposed to the |
| 88 | // platform. |
| 89 | bool PlatformIsChildOfLeaf() const; |
| 90 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 91 | // Return the previous sibling of this object, or NULL if it's the first |
| 92 | // child of its parent. |
| 93 | BrowserAccessibility* GetPreviousSibling(); |
| 94 | |
| 95 | // Return the next sibling of this object, or NULL if it's the last child |
| 96 | // of its parent. |
| 97 | BrowserAccessibility* GetNextSibling(); |
| 98 | |
[email protected] | 9052cca | 2011-11-30 23:59:31 | [diff] [blame] | 99 | // Returns the bounds of this object in coordinates relative to the |
| 100 | // top-left corner of the overall web area. |
[email protected] | 7f2d9f6b | 2013-06-13 22:57:01 | [diff] [blame] | 101 | gfx::Rect GetLocalBoundsRect() const; |
[email protected] | 02747d4e | 2010-11-03 19:10:00 | [diff] [blame] | 102 | |
[email protected] | 9052cca | 2011-11-30 23:59:31 | [diff] [blame] | 103 | // Returns the bounds of this object in screen coordinates. |
[email protected] | 7f2d9f6b | 2013-06-13 22:57:01 | [diff] [blame] | 104 | gfx::Rect GetGlobalBoundsRect() const; |
[email protected] | 9052cca | 2011-11-30 23:59:31 | [diff] [blame] | 105 | |
[email protected] | 516c16a | 2013-11-04 21:32:20 | [diff] [blame] | 106 | // 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 |
| 108 | // role is WebAXRoleStaticText. |
| 109 | gfx::Rect GetLocalBoundsForRange(int start, int len) const; |
| 110 | |
| 111 | // Same as GetLocalBoundsForRange, in screen coordinates. Only valid when |
| 112 | // the role is WebAXRoleStaticText. |
| 113 | gfx::Rect GetGlobalBoundsForRange(int start, int len) const; |
| 114 | |
nektar | 6baff46f | 2015-02-25 06:22:35 | [diff] [blame] | 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 | |
[email protected] | 9052cca | 2011-11-30 23:59:31 | [diff] [blame] | 120 | // Returns the deepest descendant that contains the specified point |
| 121 | // (in global screen coordinates). |
[email protected] | 02747d4e | 2010-11-03 19:10:00 | [diff] [blame] | 122 | BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point); |
| 123 | |
[email protected] | c47754096 | 2013-03-07 00:43:10 | [diff] [blame] | 124 | // Marks this object for deletion, releases our reference to it, and |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 125 | // nulls out the pointer to the underlying AXNode. May not delete |
| 126 | // the object immediately due to reference counting. |
[email protected] | 8368e3c | 2011-03-08 19:26:24 | [diff] [blame] | 127 | // |
[email protected] | c47754096 | 2013-03-07 00:43:10 | [diff] [blame] | 128 | // Reference counting is used on some platforms because the |
[email protected] | 8368e3c | 2011-03-08 19:26:24 | [diff] [blame] | 129 | // operating system may hold onto a reference to a BrowserAccessibility |
[email protected] | c47754096 | 2013-03-07 00:43:10 | [diff] [blame] | 130 | // object even after we're through with it. When a BrowserAccessibility |
| 131 | // has had Destroy() called but its reference count is not yet zero, |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 132 | // instance_active() returns false and queries on this object return failure. |
[email protected] | c47754096 | 2013-03-07 00:43:10 | [diff] [blame] | 133 | virtual void Destroy(); |
[email protected] | 8368e3c | 2011-03-08 19:26:24 | [diff] [blame] | 134 | |
| 135 | // Subclasses should override this to support platform reference counting. |
| 136 | virtual void NativeAddReference() { } |
| 137 | |
| 138 | // Subclasses should override this to support platform reference counting. |
[email protected] | 402da9f | 2011-03-08 19:45:41 | [diff] [blame] | 139 | virtual void NativeReleaseReference(); |
[email protected] | 8368e3c | 2011-03-08 19:26:24 | [diff] [blame] | 140 | |
| 141 | // |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 142 | // Accessors |
[email protected] | 8368e3c | 2011-03-08 19:26:24 | [diff] [blame] | 143 | // |
| 144 | |
[email protected] | 0d7dad6 | 2010-10-19 21:18:50 | [diff] [blame] | 145 | BrowserAccessibilityManager* manager() const { return manager_; } |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 146 | bool instance_active() const { return node_ != NULL; } |
| 147 | ui::AXNode* node() const { return node_; } |
[email protected] | 99d408f | 2013-12-04 07:19:43 | [diff] [blame] | 148 | |
[email protected] | c1f9be74 | 2014-04-10 13:15:46 | [diff] [blame] | 149 | // These access the internal accessibility tree, which doesn't necessarily |
| 150 | // reflect the accessibility tree that should be exposed on each platform. |
| 151 | // Use PlatformChildCount and PlatformGetChild to implement platform |
| 152 | // accessibility APIs. |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 153 | uint32 InternalChildCount() const; |
| 154 | BrowserAccessibility* InternalGetChild(uint32 child_index) const; |
[email protected] | c1f9be74 | 2014-04-10 13:15:46 | [diff] [blame] | 155 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 156 | BrowserAccessibility* GetParent() const; |
| 157 | int32 GetIndexInParent() const; |
[email protected] | c1f9be74 | 2014-04-10 13:15:46 | [diff] [blame] | 158 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 159 | int32 GetId() const; |
| 160 | const ui::AXNodeData& GetData() const; |
| 161 | gfx::Rect GetLocation() const; |
| 162 | int32 GetRole() const; |
| 163 | int32 GetState() const; |
| 164 | |
mohan.reddy | 0079fba | 2014-09-25 07:25:23 | [diff] [blame] | 165 | typedef base::StringPairs HtmlAttributes; |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 166 | const HtmlAttributes& GetHtmlAttributes() const; |
[email protected] | c1f9be74 | 2014-04-10 13:15:46 | [diff] [blame] | 167 | |
dmazzoni | 9b381f3 | 2015-01-27 00:34:08 | [diff] [blame] | 168 | |
| 169 | // Returns true if this is a native platform-specific object, vs a |
| 170 | // cross-platform generic object. Don't call ToBrowserAccessibilityXXX if |
| 171 | // IsNative returns false. |
| 172 | virtual bool IsNative() const; |
| 173 | |
[email protected] | 95b3f544 | 2012-05-06 17:10:07 | [diff] [blame] | 174 | #if defined(OS_MACOSX) && __OBJC__ |
[email protected] | cd3e2d90 | 2012-05-09 07:05:20 | [diff] [blame] | 175 | BrowserAccessibilityCocoa* ToBrowserAccessibilityCocoa(); |
[email protected] | 1dbadbd | 2010-10-13 18:50:10 | [diff] [blame] | 176 | #elif defined(OS_WIN) |
[email protected] | cd3e2d90 | 2012-05-09 07:05:20 | [diff] [blame] | 177 | BrowserAccessibilityWin* ToBrowserAccessibilityWin(); |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 178 | #endif |
| 179 | |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 180 | // Accessing accessibility attributes: |
| 181 | // |
| 182 | // There are dozens of possible attributes for an accessibility node, |
| 183 | // but only a few tend to apply to any one object, so we store them |
| 184 | // in sparse arrays of <attribute id, attribute value> pairs, organized |
| 185 | // by type (bool, int, float, string, int list). |
| 186 | // |
| 187 | // There are three accessors for each type of attribute: one that returns |
| 188 | // true if the attribute is present and false if not, one that takes a |
| 189 | // pointer argument and returns true if the attribute is present (if you |
| 190 | // need to distinguish between the default value and a missing attribute), |
| 191 | // and another that returns the default value for that type if the |
| 192 | // attribute is not present. In addition, strings can be returned as |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 193 | // either std::string or base::string16, for convenience. |
[email protected] | ee84512 | 2011-09-01 08:44:16 | [diff] [blame] | 194 | |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 195 | bool HasBoolAttribute(ui::AXBoolAttribute attr) const; |
| 196 | bool GetBoolAttribute(ui::AXBoolAttribute attr) const; |
| 197 | bool GetBoolAttribute(ui::AXBoolAttribute attr, bool* value) const; |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 198 | |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 199 | bool HasFloatAttribute(ui::AXFloatAttribute attr) const; |
| 200 | float GetFloatAttribute(ui::AXFloatAttribute attr) const; |
| 201 | bool GetFloatAttribute(ui::AXFloatAttribute attr, float* value) const; |
[email protected] | 02747d4e | 2010-11-03 19:10:00 | [diff] [blame] | 202 | |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 203 | bool HasIntAttribute(ui::AXIntAttribute attribute) const; |
| 204 | int GetIntAttribute(ui::AXIntAttribute attribute) const; |
| 205 | bool GetIntAttribute(ui::AXIntAttribute attribute, int* value) const; |
[email protected] | ee84512 | 2011-09-01 08:44:16 | [diff] [blame] | 206 | |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 207 | bool HasStringAttribute( |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 208 | ui::AXStringAttribute attribute) const; |
| 209 | const std::string& GetStringAttribute(ui::AXStringAttribute attribute) const; |
| 210 | bool GetStringAttribute(ui::AXStringAttribute attribute, |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 211 | std::string* value) const; |
| 212 | |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 213 | bool GetString16Attribute(ui::AXStringAttribute attribute, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 214 | base::string16* value) const; |
| 215 | base::string16 GetString16Attribute( |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 216 | ui::AXStringAttribute attribute) const; |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 217 | |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 218 | bool HasIntListAttribute(ui::AXIntListAttribute attribute) const; |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 219 | const std::vector<int32>& GetIntListAttribute( |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 220 | ui::AXIntListAttribute attribute) const; |
| 221 | bool GetIntListAttribute(ui::AXIntListAttribute attribute, |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 222 | std::vector<int32>* value) const; |
| 223 | |
[email protected] | ee84512 | 2011-09-01 08:44:16 | [diff] [blame] | 224 | // Retrieve the value of a html attribute from the attribute map and |
| 225 | // returns true if found. |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 226 | bool GetHtmlAttribute(const char* attr, base::string16* value) const; |
[email protected] | eecf89f0 | 2013-08-20 23:41:51 | [diff] [blame] | 227 | bool GetHtmlAttribute(const char* attr, std::string* value) const; |
[email protected] | ee84512 | 2011-09-01 08:44:16 | [diff] [blame] | 228 | |
[email protected] | 38f1e3b05 | 2012-02-10 21:46:07 | [diff] [blame] | 229 | // Utility method to handle special cases for ARIA booleans, tristates and |
| 230 | // booleans which have a "mixed" state. |
| 231 | // |
| 232 | // Warning: the term "Tristate" is used loosely by the spec and here, |
| 233 | // as some attributes support a 4th state. |
| 234 | // |
| 235 | // The following attributes are appropriate to use with this method: |
| 236 | // aria-selected (selectable) |
| 237 | // aria-grabbed (grabbable) |
| 238 | // aria-expanded (expandable) |
| 239 | // aria-pressed (toggleable/pressable) -- supports 4th "mixed" state |
| 240 | // aria-checked (checkable) -- supports 4th "mixed state" |
| 241 | bool GetAriaTristate(const char* attr_name, |
| 242 | bool* is_defined, |
| 243 | bool* is_mixed) const; |
| 244 | |
[email protected] | c43b0dc | 2011-12-03 04:31:13 | [diff] [blame] | 245 | // Returns true if the bit corresponding to the given state enum is 1. |
[email protected] | 5eec2f5 | 2014-01-06 22:30:54 | [diff] [blame] | 246 | bool HasState(ui::AXState state_enum) const; |
[email protected] | c43b0dc | 2011-12-03 04:31:13 | [diff] [blame] | 247 | |
je_julie.kim | ff9c8d3 | 2015-01-12 11:14:46 | [diff] [blame] | 248 | // Returns true if this node is an cell or an table header. |
| 249 | bool IsCellOrTableHeaderRole() const; |
| 250 | |
[email protected] | ee84512 | 2011-09-01 08:44:16 | [diff] [blame] | 251 | // Returns true if this node is an editable text field of any kind. |
| 252 | bool IsEditableText() const; |
[email protected] | 02747d4e | 2010-11-03 19:10:00 | [diff] [blame] | 253 | |
dmazzoni | 8b43c60 | 2014-12-17 21:23:35 | [diff] [blame] | 254 | // True if this is a web area, and its grandparent is a presentational iframe. |
| 255 | bool IsWebAreaForPresentationalIframe() const; |
| 256 | |
[email protected] | aa50cea8 | 2010-11-05 23:02:38 | [diff] [blame] | 257 | protected: |
| 258 | BrowserAccessibility(); |
| 259 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 260 | // The manager of this tree of accessibility objects. |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 261 | BrowserAccessibilityManager* manager_; |
| 262 | |
[email protected] | d96f384 | 2014-04-21 18:07:29 | [diff] [blame] | 263 | // The underlying node. |
| 264 | ui::AXNode* node_; |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 265 | |
[email protected] | 99d408f | 2013-12-04 07:19:43 | [diff] [blame] | 266 | private: |
[email protected] | 3dba3ed | 2013-12-17 21:24:01 | [diff] [blame] | 267 | // Return the sum of the lengths of all static text descendants, |
| 268 | // including this object if it's static text. |
| 269 | int GetStaticTextLenRecursive() const; |
| 270 | |
dmazzoni | e8091802 | 2015-01-16 00:33:37 | [diff] [blame] | 271 | // Similar to GetParent(), but includes nodes that are the host of a |
| 272 | // subtree rather than skipping over them - because they contain important |
| 273 | // bounds offsets. |
| 274 | BrowserAccessibility* GetParentForBoundsCalculation() const; |
| 275 | |
dmazzoni | 9df5f8fd | 2015-02-04 07:36:06 | [diff] [blame] | 276 | // Convert the bounding rectangle of an element (which is relative to |
| 277 | // its nearest scrollable ancestor) to local bounds (which are relative |
| 278 | // to the top of the web accessibility tree). |
| 279 | gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; |
| 280 | |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 281 | DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 282 | }; |
| 283 | |
[email protected] | e6b3487 | 2012-10-24 20:51:32 | [diff] [blame] | 284 | } // namespace content |
| 285 | |
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 286 | #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |