OSDN Git Service

A few small cleanning-ups.
authorHuahui Wu <hwu@google.com>
Mon, 24 Jan 2011 20:07:37 +0000 (12:07 -0800)
committerHuahui Wu <hwu@google.com>
Mon, 24 Jan 2011 20:07:37 +0000 (12:07 -0800)
1. Remove mDeferMultiTouch in WebView, it was for testing only but
we don't need it now since we always pass MultiTouch to WebKit.

2. Remove the use of mDeferMultiTouch in DRT tests.

3. Correct the index of getX(Y) for the second touch point in the
debug string of MotionEvent.

Change-Id: Ib63cfc5935af1a169ed26b2b138f74908492bc18

core/java/android/view/MotionEvent.java
core/java/android/webkit/WebView.java
tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java

index db2cd50..b95de64 100644 (file)
@@ -1569,7 +1569,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
             + " device=" + mDeviceId
             + " source=0x" + Integer.toHexString(mSource)
             + (getPointerCount() > 1 ?
-                " pointerId2=" + getPointerId(1) + " x2=" + getX(2) + " y2=" + getY(2) : "")
+                " pointerId2=" + getPointerId(1) + " x2=" + getX(1) + " y2=" + getY(1) : "")
             + "}";
     }
 
index 83061ec..1271ba6 100644 (file)
@@ -498,9 +498,6 @@ public class WebView extends AbsoluteLayout
     // default is not set, the UI will continue handle them.
     private boolean mDeferTouchProcess;
 
-    // if true, multi-touch events will be passed to webkit directly before UI
-    private boolean mDeferMultitouch = false;
-
     // Currently, multi-touch events are sent to WebKit first then back to
     // WebView while single-touch events are handled in WebView first.
     // So there is a chance that a single-touch move event is handled in WebView
@@ -8165,17 +8162,6 @@ public class WebView extends AbsoluteLayout
     }
 
     /**
-     * Toggle whether multi touch events should be sent to webkit
-     * no matter if UI wants to handle it first.
-     *
-     * @hide This is only used by the webkit layout test.
-     */
-    public void setDeferMultiTouch(boolean value) {
-      mDeferMultitouch = value;
-      Log.v(LOGTAG, "set mDeferMultitouch to " + value);
-    }
-
-    /**
      *  Update our cache with updatedText.
      *  @param updatedText  The new text to put in our cache.
      */
index 9c4fa97..3ea4911 100644 (file)
@@ -158,10 +158,6 @@ public class TestShellActivity extends Activity implements LayoutTestController
         // WebView::setJsFlags is noop in JSC build.
         mWebView.setJsFlags("--expose_gc");
 
-        // Always send multitouch events to Webkit since the layout test
-        // is only for the Webkit not the browser's UI.
-        mWebView.setDeferMultiTouch(true);
-
         mHandler = new AsyncHandler();
 
         Intent intent = getIntent();
index ce546ec..d9f5dd4 100644 (file)
@@ -372,7 +372,6 @@ public class LayoutTestsExecutor extends Activity {
         webView.setTouchInterval(-1);
 
         webView.clearCache(true);
-        webView.setDeferMultiTouch(true);
 
         WebSettings webViewSettings = webView.getSettings();
         webViewSettings.setAppCacheEnabled(true);