Add basic support for accessibility hit testing within web contents.
BUG=59890
TEST=Manual. Inspect32.
Review URL: http://codereview.chromium.org/4292001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64943 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/accessibility/browser_accessibility.h b/chrome/browser/accessibility/browser_accessibility.h
index 2e39ba0..7bd4a63 100644
--- a/chrome/browser/accessibility/browser_accessibility.h
+++ b/chrome/browser/accessibility/browser_accessibility.h
@@ -90,6 +90,12 @@
// of its parent.
BrowserAccessibility* GetNextSibling();
+ // Returns the bounds of this object in screen coordinates.
+ gfx::Rect GetBoundsRect();
+
+ // Returns the deepest descendant that contains the specified point.
+ BrowserAccessibility* BrowserAccessibilityForPoint(const gfx::Point& point);
+
// Accessors
const std::map<int32, string16>& attributes() const { return attributes_; }
int32 child_id() const { return child_id_; }
@@ -118,6 +124,20 @@
protected:
BrowserAccessibility();
+ // Return true if this attribute is in the attributes map.
+ bool HasAttribute(WebAccessibility::Attribute attribute);
+
+ // Retrieve the string value of an attribute from the attribute map and
+ // returns true if found.
+ bool GetAttribute(WebAccessibility::Attribute attribute, string16* value);
+
+ // Retrieve the value of an attribute from the attribute map and
+ // if found and nonempty, try to convert it to an integer.
+ // Returns true only if both the attribute was found and it was successfully
+ // converted to an integer.
+ bool GetAttributeAsInt(
+ WebAccessibility::Attribute attribute, int* value_int);
+
// The manager of this tree of accessibility objects; needed for
// global operations like focus tracking.
BrowserAccessibilityManager* manager_;