Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1657)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 2548363007: Emulate Android joystick scroll with synthetic mouse wheel event (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 952f300d2e701811e9d720a2d1a3bea586a45b42..15c6e45584aef470c2ccc04c9533d8e3e6d1312b 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -453,7 +453,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
mContext = context;
mProductVersion = productVersion;
mRenderCoordinates = new RenderCoordinates();
- mJoystickScrollProvider = new JoystickScrollProvider(this);
+ mJoystickScrollProvider = new JoystickScrollProvider();
mAccessibilityManager = (AccessibilityManager)
getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
mSystemCaptioningBridge = CaptioningBridgeFactory.getSystemCaptioningBridge(mContext);
@@ -630,10 +630,13 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
mZoomControlsDelegate = NO_OP_ZOOM_CONTROLS_DELEGATE;
+ mJoystickScrollProvider.initialize(webContents, getContainerView());
+
final float dipScale = windowAndroid.getDisplay().getDipScale();
mRenderCoordinates.reset();
mRenderCoordinates.setDeviceScaleFactor(dipScale, windowAndroid.getContext());
+ mJoystickScrollProvider.setDeviceScaleFactor(dipScale, windowAndroid.getContext());
mNativeContentViewCore = nativeInit(webContents, mViewAndroidDelegate, windowNativePointer,
dipScale, mRetainedJavaScriptObjects);
@@ -2872,6 +2875,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
if (windowAndroid == null || mNativeContentViewCore == 0) return;
mRenderCoordinates.setDeviceScaleFactor(dipScale, getWindowAndroid().getContext());
+ mJoystickScrollProvider.setDeviceScaleFactor(dipScale, getWindowAndroid().getContext());
nativeSetDIPScale(mNativeContentViewCore, dipScale);
}

Powered by Google App Engine
This is Rietveld 408576698