diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-07 17:09:01 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-07-10 11:17:53 +0200 |
commit | 7b55df0b2c04f1a58922585415bc2e32c5d68e08 (patch) | |
tree | a1e7a68e48047eb4006e543c8fd1570a7bb94de5 /android | |
parent | LOAndroid3: upgrade TextureGenerator/Reaper to the latest version (diff) | |
download | core-7b55df0b2c04f1a58922585415bc2e32c5d68e08.tar.gz core-7b55df0b2c04f1a58922585415bc2e32c5d68e08.zip |
LOAndoid3: clean-up SubdocumentScrollHelper
Change-Id: Ie02b0a08c8bdcb93929fb742729a0169ee6a0666
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/SubdocumentScrollHelper.java | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/SubdocumentScrollHelper.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/SubdocumentScrollHelper.java index f24a5b7adaa1..30b4b30a5a99 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/SubdocumentScrollHelper.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/SubdocumentScrollHelper.java @@ -40,19 +40,9 @@ package org.mozilla.gecko.ui; import android.graphics.PointF; import android.os.Handler; -import android.util.Log; -import org.json.JSONException; -import org.json.JSONObject; -import org.mozilla.gecko.GeckoEventListener; - -class SubdocumentScrollHelper implements GeckoEventListener { - private static final String LOGTAG = "GeckoSubdocumentScrollHelper"; - - private static String MESSAGE_PANNING_OVERRIDE = "Panning:Override"; - private static String MESSAGE_CANCEL_OVERRIDE = "Panning:CancelOverride"; - private static String MESSAGE_SCROLL = "Gesture:Scroll"; - private static String MESSAGE_SCROLL_ACK = "Gesture:ScrollAck"; +class SubdocumentScrollHelper { + private static final String LOGTAG = SubdocumentScrollHelper.class.getSimpleName(); private final PanZoomController mPanZoomController; private final Handler mUiHandler; @@ -64,12 +54,7 @@ class SubdocumentScrollHelper implements GeckoEventListener { SubdocumentScrollHelper(PanZoomController controller) { mPanZoomController = controller; - // mUiHandler will be bound to the UI thread since that's where this constructor runs mUiHandler = new Handler(); - - //GeckoAppShell.registerGeckoEventListener(MESSAGE_PANNING_OVERRIDE, this); - //GeckoAppShell.registerGeckoEventListener(MESSAGE_CANCEL_OVERRIDE, this); - //GeckoAppShell.registerGeckoEventListener(MESSAGE_SCROLL_ACK, this); } boolean scrollBy(PointF displacement) { @@ -85,15 +70,6 @@ class SubdocumentScrollHelper implements GeckoEventListener { mOverrideScrollAck = false; mOverrideScrollPending = false; - JSONObject json = new JSONObject(); - try { - json.put("x", displacement.x); - json.put("y", displacement.y); - } catch (JSONException e) { - Log.e(LOGTAG, "Error forming subwindow scroll message: ", e); - } - //GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent(MESSAGE_SCROLL, json.toString())); - return true; } @@ -109,32 +85,4 @@ class SubdocumentScrollHelper implements GeckoEventListener { return mScrollSucceeded; } - // GeckoEventListener implementation - - public void handleMessage(final String event, final JSONObject message) { - // this comes in on the gecko thread; hand off the handling to the UI thread - mUiHandler.post(new Runnable() { - public void run() { - Log.i(LOGTAG, "Got message: " + event); - try { - if (MESSAGE_PANNING_OVERRIDE.equals(event)) { - mOverridePanning = true; - mOverrideScrollAck = true; - mOverrideScrollPending = false; - mScrollSucceeded = true; - } else if (MESSAGE_CANCEL_OVERRIDE.equals(event)) { - mOverridePanning = false; - } else if (MESSAGE_SCROLL_ACK.equals(event)) { - mOverrideScrollAck = true; - mScrollSucceeded = message.getBoolean("scrolled"); - if (mOverridePanning && mOverrideScrollPending) { - scrollBy(mPanZoomController.getDisplacement()); - } - } - } catch (Exception e) { - Log.e(LOGTAG, "Exception handling message", e); - } - } - }); - } } |