| 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 11cfc9af8ca7fa069d01970574d7bc9c87a2492c..d71e9585de892cb373836d9633f341c44008bb16 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 | 
| @@ -63,6 +63,7 @@ import org.chromium.content.browser.ContentViewGestureHandler.MotionEventDelegat | 
| 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.GamepadAdapter; | 
| import org.chromium.content.browser.input.HandleView; | 
| import org.chromium.content.browser.input.ImeAdapter; | 
| import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFactory; | 
| @@ -466,6 +467,7 @@ public class ContentViewCore | 
| getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); | 
| mGestureStateListeners = new ObserverList<GestureStateListener>(); | 
| mGestureStateListenersIterator = mGestureStateListeners.rewindableIterator(); | 
| +        GamepadAdapter.initialize(context); | 
| } | 
|  | 
| /** | 
| @@ -1814,10 +1816,13 @@ public class ContentViewCore | 
| * @see View#dispatchKeyEvent(KeyEvent) | 
| */ | 
| public boolean dispatchKeyEvent(KeyEvent event) { | 
| + | 
| if (getContentViewClient().shouldOverrideKeyEvent(event)) { | 
| return mContainerViewInternals.super_dispatchKeyEvent(event); | 
| } | 
|  | 
| +        if (GamepadAdapter.getInstance().handleKeyEvent(event)) return true; | 
| + | 
| if (mImeAdapter.dispatchKeyEvent(event)) return true; | 
|  | 
| return mContainerViewInternals.super_dispatchKeyEvent(event); | 
| @@ -1868,6 +1873,9 @@ public class ContentViewCore | 
| return true; | 
| } | 
| } | 
| + | 
| +        if (GamepadAdapter.getInstance().handleMotionEvent(event)) return true; | 
| + | 
| return mContainerViewInternals.super_onGenericMotionEvent(event); | 
| } | 
|  | 
|  |