Commit ad06cdec authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Send Android accessibility "content changed" event for any change.

Specifically, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED should
be fired on the appropriate node any time the accessibility tree changes
- previously we were only firing it in a few circumstances. That guarantees
tools like uiautomatorviewer won't see a stale accessibility tree.

BUG=286374

Review URL: https://chromiumcodereview.appspot.com/23481011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221853 0039d316-1c4b-4281-b951-d872f2087c98
parent d160e49b
...@@ -90,6 +90,12 @@ void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent( ...@@ -90,6 +90,12 @@ void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent(
if (obj.is_null()) if (obj.is_null())
return; return;
// Always send AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED to notify
// the Android system that the accessibility hierarchy rooted at this
// node has changed.
Java_BrowserAccessibilityManager_handleContentChanged(
env, obj.obj(), node->renderer_id());
switch (event_type) { switch (event_type) {
case WebKit::WebAXEventLoadComplete: case WebKit::WebAXEventLoadComplete:
Java_BrowserAccessibilityManager_handlePageLoaded( Java_BrowserAccessibilityManager_handlePageLoaded(
...@@ -131,9 +137,6 @@ void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent( ...@@ -131,9 +137,6 @@ void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent(
if (node->IsEditableText()) { if (node->IsEditableText()) {
Java_BrowserAccessibilityManager_handleEditableTextChanged( Java_BrowserAccessibilityManager_handleEditableTextChanged(
env, obj.obj(), node->renderer_id()); env, obj.obj(), node->renderer_id());
} else {
Java_BrowserAccessibilityManager_handleContentChanged(
env, obj.obj(), node->renderer_id());
} }
break; break;
default: default:
......
...@@ -268,13 +268,11 @@ public class BrowserAccessibilityManager { ...@@ -268,13 +268,11 @@ public class BrowserAccessibilityManager {
@CalledByNative @CalledByNative
private void handleTextSelectionChanged(int id) { private void handleTextSelectionChanged(int id) {
sendAccessibilityEvent(id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED); sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED);
} }
@CalledByNative @CalledByNative
private void handleEditableTextChanged(int id) { private void handleEditableTextChanged(int id) {
sendAccessibilityEvent(id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);
} }
......
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