Bug 487686: Get rid of pref for turning kinetic on/off, r=stuart, mfinkle
authorBen Combee <combee@mozilla.com>
Fri, 17 Apr 2009 17:02:24 -0400
changeset 65172 3784b499c46dca3784d68da890929766fd277666
parent 65171 70ff92acb3c6f3da20509f8e1e132a977d9f24fb
child 65173 67689553ff42898642827b3dadb380215f633d26
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersstuart, mfinkle
bugs487686
Bug 487686: Get rid of pref for turning kinetic on/off, r=stuart, mfinkle
mobile/app/mobile.js
mobile/chrome/content/InputHandler.js
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -37,17 +37,16 @@
 #filter substitution
 
 pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
 pref("general.useragent.extra.mobile", "@APP_UA_NAME@/@APP_VERSION@");
 pref("browser.chromeURL", "chrome://browser/content/");
 
 pref("browser.startup.homepage", "about:firstrun");
 pref("browser.ui.cursor", false);
-pref("browser.ui.panning.kinetic", true);
 
 pref("javascript.options.showInConsole", false);
 
 /* cache prefs */
 pref("browser.cache.disk.enable", false);
 pref("browser.cache.disk.capacity", 0);
 pref("browser.cache.memory.enable", true);
 pref("browser.cache.memory.capacity", 1024);
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -87,21 +87,18 @@ function InputHandler() {
 
   let stack = document.getElementById("browser-container");
   stack.addEventListener("DOMMouseScroll", this, true);
 
   let browserCanvas = document.getElementById("browser-canvas");
   browserCanvas.addEventListener("keydown", this, true);
   browserCanvas.addEventListener("keyup", this, true);
 
-  let prefsvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch2);
-  let allowKinetic = prefsvc.getBoolPref("browser.ui.panning.kinetic");
-
   this._modules.push(new ChromeInputModule(this, browserCanvas));
-  this._modules.push(new ContentPanningModule(this, browserCanvas, allowKinetic));
+  this._modules.push(new ContentPanningModule(this, browserCanvas));
   this._modules.push(new ContentClickingModule(this));
   this._modules.push(new ScrollwheelModule(this));
 }
 
 InputHandler.prototype = {
   _modules : [],
   _grabbed : null,
   _ignoreEvents: false,
@@ -580,30 +577,27 @@ KineticData.prototype = {
       if (mbLast.sx == sx && mbLast.sy == sy)
 	return;
     }
 
     this.momentumBuffer.push({'t': Date.now(), 'sx' : sx, 'sy' : sy});
   }
 };
 
-function ContentPanningModule(owner, browserCanvas, useKinetic) {
+function ContentPanningModule(owner, browserCanvas) {
   this._owner = owner;
-  if (useKinetic !== undefined)
-    this._useKinetic = useKinetic;
   this._browserCanvas = browserCanvas;
   this._dragData = new DragData(this, 10, 200);
   this._kineticData = new KineticData(this);
 }
 
 ContentPanningModule.prototype = {
   _owner: null,
   _dragData: null,
 
-  _useKinetic: true,
   _kineticData: null,
 
   handleEvent: function handleEvent(aEvent) {
     // exit early for events outside displayed content area
     if (aEvent.target !== this._browserCanvas)
       return;
 
     switch (aEvent.type) {
@@ -671,27 +665,20 @@ ContentPanningModule.prototype = {
 
   _dragStop: function _dragStop(sX, sY) {
     let dragData = this._dragData;
 
     this._owner.ungrab(this);
 
     [sX, sY] = dragData.lockMouseMove(sX, sY);
 
-    if (this._useKinetic) {
-      // start kinetic scrolling here for canvas only
-      if (!this._kineticData.startKinetic(sX, sY))
-        this._kineticData.endKinetic(sX, sY);
-      dragData.reset();
-    }
-    else {
-      ws.dragStop();
-      // flush any paints that might be left so that our next pan will be fast
-      Browser.canvasBrowser.endPanning();
-    }
+    // start kinetic scrolling here for canvas only
+    if (!this._kineticData.startKinetic(sX, sY))
+      this._kineticData.endKinetic(sX, sY);
+    dragData.reset();
   },
 
   _dragBy: function _dragMove(dx, dy) {
     let panned = ws.dragBy(dx, dy);
     return panned;
   },
 
   _dragMove: function _dragMove(sX, sY) {
@@ -735,18 +722,17 @@ ContentPanningModule.prototype = {
     // if we never received a mouseDown, we need to go ahead and set this data
     if (!dragData.sX)
       dragData.setDragPosition(aEvent.screenX, aEvent.screenY);
 
     let [sX, sY] = dragData.lockMouseMove(aEvent.screenX, aEvent.screenY);
 
     // even if we haven't started dragging yet, we should queue up the
     // mousemoves in case we do start
-    if (this._useKinetic)
-      this._kineticData.addData(sX, sY);
+    this._kineticData.addData(sX, sY);
 
     this.detectEarlyDrag();
 
     //dragData.detectEarlyDrag(sX, sY);
 
     if (dragData.dragging)
       this._dragMove(sX, sY);
   },