Bug 682017 - Remove CustomKeySender and use content KeyEvents forwarding; r=mfinkle

This commit is contained in:
Oleg Romashin 2011-08-29 17:26:23 +01:00
parent 9a0244c149
commit 85e15a8352
2 changed files with 0 additions and 49 deletions

View File

@ -182,7 +182,6 @@ var Browser = {
/* handles web progress management for open browsers */
Elements.browsers.webProgress = new Browser.WebProgress();
this.keySender = new ContentCustomKeySender(Elements.browsers);
let mouseModule = new MouseModule();
let gestureModule = new GestureModule(Elements.browsers);
let scrollWheelModule = new ScrollwheelModule(Elements.browsers);
@ -2065,52 +2064,6 @@ const ContentTouchHandler = {
}
};
/** Watches for mouse events in chrome and sends them to content. */
function ContentCustomKeySender(container) {
container.addEventListener("keypress", this, false);
container.addEventListener("keyup", this, false);
container.addEventListener("keydown", this, false);
}
ContentCustomKeySender.prototype = {
handleEvent: function handleEvent(aEvent) {
if (Elements.contentShowing.getAttribute("disabled") == "true")
return;
let browser = getBrowser();
if (browser && browser.active && browser.getAttribute("remote") == "true") {
aEvent.stopPropagation();
aEvent.preventDefault();
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
fl.sendCrossProcessKeyEvent(aEvent.type,
aEvent.keyCode,
(aEvent.type != "keydown") ? aEvent.charCode : null,
this._parseModifiers(aEvent));
}
},
_parseModifiers: function _parseModifiers(aEvent) {
const masks = Ci.nsIDOMNSEvent;
let mval = 0;
if (aEvent.shiftKey)
mval |= masks.SHIFT_MASK;
if (aEvent.ctrlKey)
mval |= masks.CONTROL_MASK;
if (aEvent.altKey)
mval |= masks.ALT_MASK;
if (aEvent.metaKey)
mval |= masks.META_MASK;
return mval;
},
toString: function toString() {
return "[ContentCustomKeySender] { }";
}
};
/**
* Utility class to handle manipulations of the identity indicators in the UI
*/
@ -3014,7 +2967,6 @@ Tab.prototype = {
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
fl.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
fl.eventMode = Ci.nsIFrameLoader.EVENT_MODE_DONT_FORWARD_TO_CHILD;
return browser;
},

View File

@ -593,7 +593,6 @@ var FormHelperUI = {
if (focusedElement && focusedElement.localName == "browser")
return;
Browser.keySender.handleEvent(aEvent);
break;
case "SizeChanged":