diff --git a/b2g/chrome/content/shell.xul b/b2g/chrome/content/shell.xul
index 222a8172e7a..63905bb84ac 100644
--- a/b2g/chrome/content/shell.xul
+++ b/b2g/chrome/content/shell.xul
@@ -16,9 +16,6 @@
onunload="shell.stop();">
-#ifndef MOZ_TOUCH
-
-#endif
15 ||
- Math.abs(this.startY - evt.pageY) > 15)
- window.clearTimeout(contextMenuTimeout);
- type = 'touchmove';
- break;
-
- case 'mouseup':
- if (!eventTarget)
- return;
- debug('mouseup:');
-
- window.clearTimeout(contextMenuTimeout);
- this.target = null;
- type = 'touchend';
- break;
-
- case 'unload':
- if (!eventTarget)
- return;
-
- window.clearTimeout(contextMenuTimeout);
- this.target = null;
- TouchEventHandler.stop();
- return;
-
- case 'click':
- if (isNewTouchAction) {
- // Mouse events has been cancelled so dispatch a sequence
- // of events to where touchend has been fired
- if (preventMouseEvents) {
- evt.preventDefault();
- evt.stopPropagation();
-
- let target = evt.target;
- ignoreEvents = true;
- window.setTimeout(function dispatchMouseEvents(self) {
- self.fireMouseEvent('mousemove', evt);
- self.fireMouseEvent('mousedown', evt);
- self.fireMouseEvent('mouseup', evt);
- ignoreEvents = false;
- }, 0, this);
- }
-
- debug('click: fire');
- }
- return;
- }
-
- let target = eventTarget || this.target;
- if (target && type) {
- let touchEvent = this.sendTouchEvent(evt, target, type);
- if (touchEvent.defaultPrevented && canPreventMouseEvents)
- preventMouseEvents = true;
- }
-
- if (preventMouseEvents) {
- evt.preventDefault();
- evt.stopPropagation();
-
- if (type != 'touchmove')
- debug('cancelled (fire ' + type + ')');
- }
- },
- fireMouseEvent: function teh_fireMouseEvent(type, evt) {
- debug(type + ': fire');
-
- let content = evt.target.ownerDocument.defaultView;
- var utils = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
- utils.sendMouseEvent(type, evt.pageX, evt.pageY, 0, 1, 0, true);
- },
- sendContextMenu: function teh_sendContextMenu(target, x, y, delay) {
- let doc = target.ownerDocument;
- let evt = doc.createEvent('MouseEvent');
- evt.initMouseEvent('contextmenu', true, true, doc.defaultView,
- 0, x, y, x, y, false, false, false, false,
- 0, null);
-
- let timeout = window.setTimeout((function contextMenu() {
- debug('fire context-menu');
-
- target.dispatchEvent(evt);
- if (!evt.defaultPrevented)
- return;
-
- doc.releaseCapture();
- this.target = null;
-
- isNewTouchAction = false;
- }).bind(this), delay);
- return timeout;
- },
- sendTouchEvent: function teh_sendTouchEvent(evt, target, name) {
- let touchEvent = document.createEvent('touchevent');
- let point = document.createTouch(window, target, 0,
- evt.pageX, evt.pageY,
- evt.screenX, evt.screenY,
- evt.clientX, evt.clientY,
- 1, 1, 0, 0);
- let touches = document.createTouchList(point);
- let targetTouches = touches;
- let changedTouches = touches;
- touchEvent.initTouchEvent(name, true, true, window, 0,
- false, false, false, false,
- touches, targetTouches, changedTouches);
- target.dispatchEvent(touchEvent);
- return touchEvent;
- }
- };
-
- window.addEventListener('ContentStart', function touchStart(evt) {
- window.removeEventListener('ContentStart', touchStart);
- TouchEventHandler.start();
- });
-})();
-
diff --git a/b2g/chrome/jar.mn b/b2g/chrome/jar.mn
index 0c7ea7bd7a5..71f4d8fef17 100644
--- a/b2g/chrome/jar.mn
+++ b/b2g/chrome/jar.mn
@@ -7,9 +7,6 @@ chrome.jar:
content/dbg-browser-actors.js (content/dbg-browser-actors.js)
* content/shell.xul (content/shell.xul)
* content/shell.js (content/shell.js)
-#ifndef MOZ_TOUCH
- content/touch.js (content/touch.js)
-#endif
content/webapi.js (content/webapi.js)
content/content.css (content/content.css)