Commit 487bac04 authored by dmazzoni's avatar dmazzoni Committed by Commit bot

Send Android accessibility event when object location changes.

Note that the LOCATION_CHANGED event isn't explicitly handled, it just gets mapped to a WINDOW_CONTENT_CHANGED event on Android.

BUG=407871

Review URL: https://codereview.chromium.org/510513003

Cr-Commit-Position: refs/heads/master@{#292216}
parent 617e4fc4
...@@ -65,7 +65,7 @@ class CONTENT_EXPORT BrowserAccessibility { ...@@ -65,7 +65,7 @@ class CONTENT_EXPORT BrowserAccessibility {
virtual bool IsNative() const; virtual bool IsNative() const;
// Called when the location changed. // Called when the location changed.
virtual void OnLocationChanged() const {} virtual void OnLocationChanged() {}
// Return true if this object is equal to or a descendant of |ancestor|. // Return true if this object is equal to or a descendant of |ancestor|.
bool IsDescendantOf(BrowserAccessibility* ancestor); bool IsDescendantOf(BrowserAccessibility* ancestor);
......
...@@ -55,6 +55,10 @@ bool BrowserAccessibilityAndroid::IsNative() const { ...@@ -55,6 +55,10 @@ bool BrowserAccessibilityAndroid::IsNative() const {
return true; return true;
} }
void BrowserAccessibilityAndroid::OnLocationChanged() {
manager()->NotifyAccessibilityEvent(ui::AX_EVENT_LOCATION_CHANGED, this);
}
bool BrowserAccessibilityAndroid::PlatformIsLeaf() const { bool BrowserAccessibilityAndroid::PlatformIsLeaf() const {
if (InternalChildCount() == 0) if (InternalChildCount() == 0)
return true; return true;
......
...@@ -15,6 +15,7 @@ class BrowserAccessibilityAndroid : public BrowserAccessibility { ...@@ -15,6 +15,7 @@ class BrowserAccessibilityAndroid : public BrowserAccessibility {
// Overrides from BrowserAccessibility. // Overrides from BrowserAccessibility.
virtual void OnDataChanged() OVERRIDE; virtual void OnDataChanged() OVERRIDE;
virtual bool IsNative() const OVERRIDE; virtual bool IsNative() const OVERRIDE;
virtual void OnLocationChanged() OVERRIDE;
virtual bool PlatformIsLeaf() const OVERRIDE; virtual bool PlatformIsLeaf() const OVERRIDE;
......
...@@ -3176,7 +3176,7 @@ bool BrowserAccessibilityWin::IsNative() const { ...@@ -3176,7 +3176,7 @@ bool BrowserAccessibilityWin::IsNative() const {
return true; return true;
} }
void BrowserAccessibilityWin::OnLocationChanged() const { void BrowserAccessibilityWin::OnLocationChanged() {
manager()->ToBrowserAccessibilityManagerWin()->MaybeCallNotifyWinEvent( manager()->ToBrowserAccessibilityManagerWin()->MaybeCallNotifyWinEvent(
EVENT_OBJECT_LOCATIONCHANGE, unique_id_win()); EVENT_OBJECT_LOCATIONCHANGE, unique_id_win());
} }
......
...@@ -105,7 +105,7 @@ BrowserAccessibilityWin ...@@ -105,7 +105,7 @@ BrowserAccessibilityWin
CONTENT_EXPORT virtual void NativeAddReference() OVERRIDE; CONTENT_EXPORT virtual void NativeAddReference() OVERRIDE;
CONTENT_EXPORT virtual void NativeReleaseReference() OVERRIDE; CONTENT_EXPORT virtual void NativeReleaseReference() OVERRIDE;
CONTENT_EXPORT virtual bool IsNative() const OVERRIDE; CONTENT_EXPORT virtual bool IsNative() const OVERRIDE;
CONTENT_EXPORT virtual void OnLocationChanged() const OVERRIDE; CONTENT_EXPORT virtual void OnLocationChanged() OVERRIDE;
// //
// IAccessible methods. // IAccessible methods.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment