mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 989198, Patch 4: Dispatch both chrome event and key event for hardward keys, and add new permission, r=fabrice.
--- b2g/chrome/content/shell.js | 13 ++++++++----- dom/apps/PermissionsTable.jsm | 6 ++++++ testing/mochitest/manifest.webapp | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-)
This commit is contained in:
parent
4d98afa8b4
commit
3e0ef2f1a8
@ -324,6 +324,8 @@ var shell = {
|
||||
chromeEventHandler.addEventListener('keydown', this, true);
|
||||
chromeEventHandler.addEventListener('keypress', this, true);
|
||||
chromeEventHandler.addEventListener('keyup', this, true);
|
||||
chromeEventHandler.addEventListener('mozbrowserbeforekeydown', this, true);
|
||||
chromeEventHandler.addEventListener('mozbrowserbeforekeyup', this, true);
|
||||
|
||||
window.addEventListener('MozApplicationManifest', this);
|
||||
window.addEventListener('mozfullscreenchange', this);
|
||||
@ -356,6 +358,8 @@ var shell = {
|
||||
window.removeEventListener('keydown', this, true);
|
||||
window.removeEventListener('keypress', this, true);
|
||||
window.removeEventListener('keyup', this, true);
|
||||
window.removeEventListener('mozbrowserbeforekeydown', this, true);
|
||||
window.removeEventListener('mozbrowserbeforekeyup', this, true);
|
||||
window.removeEventListener('MozApplicationManifest', this);
|
||||
window.removeEventListener('mozfullscreenchange', this);
|
||||
window.removeEventListener('sizemodechange', this);
|
||||
@ -420,17 +424,14 @@ var shell = {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we didn't return, then the key event represents a hardware key
|
||||
// and we need to prevent it from propagating to Gaia
|
||||
evt.stopImmediatePropagation();
|
||||
evt.preventDefault(); // Prevent keypress events (when #501496 is fixed).
|
||||
|
||||
// If it is a key down or key up event, we send a chrome event to Gaia.
|
||||
// If it is a keypress event we just ignore it.
|
||||
switch (evt.type) {
|
||||
case 'mozbrowserbeforekeydown':
|
||||
case 'keydown':
|
||||
type = type + '-press';
|
||||
break;
|
||||
case 'mozbrowserbeforekeyup':
|
||||
case 'keyup':
|
||||
type = type + '-release';
|
||||
break;
|
||||
@ -473,6 +474,8 @@ var shell = {
|
||||
case 'keydown':
|
||||
case 'keyup':
|
||||
case 'keypress':
|
||||
case 'mozbrowserbeforekeydown':
|
||||
case 'mozbrowserbeforekeyup':
|
||||
this.filterHardwareKeys(evt);
|
||||
break;
|
||||
case 'mozfullscreenchange':
|
||||
|
@ -493,6 +493,12 @@ this.PermissionsTable = { geolocation: {
|
||||
trusted: DENY_ACTION,
|
||||
privileged: DENY_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
"before-after-keyboard-event": {
|
||||
app: DENY_ACTION,
|
||||
trusted: DENY_ACTION,
|
||||
privileged: DENY_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -27,7 +27,8 @@
|
||||
"network-events":{},
|
||||
"embed-apps":{},
|
||||
"audio-channel-content":{},
|
||||
"audio-channel-alarm":{}
|
||||
"audio-channel-alarm":{},
|
||||
"before-after-keyboard-event":{}
|
||||
},
|
||||
"locales": {
|
||||
"en-US": {
|
||||
|
Loading…
Reference in New Issue
Block a user