Bug 873412 - Implement performAction for clicking. r=kats r=eeejay

This commit is contained in:
Max Li 2013-05-23 10:06:27 -04:00
parent da774fe4d1
commit 3f60765e12
2 changed files with 9 additions and 0 deletions

View File

@ -116,6 +116,7 @@ this.AccessFu = {
Services.obs.addObserver(this, 'Accessibility:NextObject', false);
Services.obs.addObserver(this, 'Accessibility:PreviousObject', false);
Services.obs.addObserver(this, 'Accessibility:Focus', false);
Services.obs.addObserver(this, 'Accessibility:ActivateObject', false);
Utils.win.addEventListener('TabOpen', this);
Utils.win.addEventListener('TabClose', this);
Utils.win.addEventListener('TabSelect', this);
@ -157,6 +158,7 @@ this.AccessFu = {
Services.obs.removeObserver(this, 'Accessibility:NextObject');
Services.obs.removeObserver(this, 'Accessibility:PreviousObject');
Services.obs.removeObserver(this, 'Accessibility:Focus');
Services.obs.removeObserver(this, 'Accessibility:ActivateObject');
if (this.doneCallback) {
this.doneCallback();
@ -259,6 +261,9 @@ this.AccessFu = {
case 'Accessibility:PreviousObject':
this.Input.moveCursor('movePrevious', 'Simple', 'gesture');
break;
case 'Accessibility:ActivateObject':
this.Input.activateCurrent();
break;
case 'Accessibility:Focus':
this._focused = JSON.parse(aData);
if (this._focused) {

View File

@ -305,6 +305,10 @@ public class GeckoAccessibility {
default:
break;
}
} else if (action == AccessibilityNodeInfo.ACTION_CLICK && virtualViewId == VIRTUAL_CURSOR_POSITION) {
GeckoAppShell.
sendEventToGecko(GeckoEvent.createBroadcastEvent("Accessibility:ActivateObject", null));
return true;
}
return host.performAccessibilityAction(action, arguments);
}