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 cd68715aec0a9a01c908cc0922ff02393b2bca86..2fa3eff0720b6227649fe32d4323f6bc308af257 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 |
@@ -59,6 +59,7 @@ import org.chromium.content.browser.ScreenOrientationListener.ScreenOrientationO |
import org.chromium.content.browser.accessibility.AccessibilityInjector; |
import org.chromium.content.browser.accessibility.BrowserAccessibilityManager; |
import org.chromium.content.browser.input.AdapterInputConnection; |
+import org.chromium.content.browser.input.GamepadList; |
import org.chromium.content.browser.input.HandleView; |
import org.chromium.content.browser.input.ImeAdapter; |
import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFactory; |
@@ -1386,6 +1387,7 @@ public class ContentViewCore |
setAccessibilityState(mAccessibilityManager.isEnabled()); |
ScreenOrientationListener.getInstance().addObserver(this, mContext); |
+ GamepadList.onAttachedToWindow(mContext); |
} |
/** |
@@ -1400,6 +1402,7 @@ public class ContentViewCore |
unregisterAccessibilityContentObserver(); |
ScreenOrientationListener.getInstance().removeObserver(this); |
+ GamepadList.onDetachedFromWindow(); |
} |
/** |
@@ -1601,6 +1604,7 @@ public class ContentViewCore |
* @see View#dispatchKeyEvent(KeyEvent) |
*/ |
public boolean dispatchKeyEvent(KeyEvent event) { |
+ if (GamepadList.dispatchKeyEvent(event)) return true; |
if (getContentViewClient().shouldOverrideKeyEvent(event)) { |
return mContainerViewInternals.super_dispatchKeyEvent(event); |
} |
@@ -1646,6 +1650,7 @@ public class ContentViewCore |
* @see View#onGenericMotionEvent(MotionEvent) |
*/ |
public boolean onGenericMotionEvent(MotionEvent event) { |
+ if (GamepadList.onGenericMotionEvent(event)) return true; |
if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { |
switch (event.getAction()) { |
case MotionEvent.ACTION_SCROLL: |