| 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 6183891f676cf9f4cffce801da100b082a4d9323..16f580014722d22ff7e85284e9fdcf652150b003 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.R;
|
| 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;
|
| @@ -447,6 +448,7 @@ public class ContentViewCore implements NavigationClient, AccessibilityStateChan
|
| getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
|
| mGestureStateListeners = new ObserverList<GestureStateListener>();
|
| mGestureStateListenersIterator = mGestureStateListeners.rewindableIterator();
|
| + GamepadAdapter.initialize(context);
|
| }
|
|
|
| /**
|
| @@ -1371,6 +1373,7 @@ public class ContentViewCore implements NavigationClient, AccessibilityStateChan
|
| ChildProcessLauncher.getBindingManager().setInForeground(pid, true);
|
| }
|
| mInForeground = true;
|
| + GamepadAdapter.getInstance().resume();
|
| nativeOnShow(mNativeContentViewCore);
|
| setAccessibilityState(mAccessibilityManager.isEnabled());
|
| }
|
| @@ -1387,6 +1390,7 @@ public class ContentViewCore implements NavigationClient, AccessibilityStateChan
|
| mInForeground = false;
|
| hidePopupDialog();
|
| setInjectedAccessibility(false);
|
| + GamepadAdapter.getInstance().pause();
|
| nativeOnHide(mNativeContentViewCore);
|
| }
|
|
|
| @@ -1694,6 +1698,8 @@ public class ContentViewCore implements NavigationClient, AccessibilityStateChan
|
| return mContainerViewInternals.super_dispatchKeyEvent(event);
|
| }
|
|
|
| + if (GamepadAdapter.getInstance().handleKeyEvent(event)) return true;
|
| +
|
| if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_CENTER) {
|
| showImeIfNeeded();
|
| // Event is not consumed here, because ImeAdapter might interpret
|
| @@ -1755,6 +1761,9 @@ public class ContentViewCore implements NavigationClient, AccessibilityStateChan
|
| return true;
|
| }
|
| }
|
| +
|
| + if (GamepadAdapter.getInstance().handleMotionEvent(event)) return true;
|
| +
|
| return mContainerViewInternals.super_onGenericMotionEvent(event);
|
| }
|
|
|
|
|