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

Unified Diff: device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadList.java

Issue 2081583002: Migrating majority of gamepad from content/browser/ to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final tweaks Created 4 years, 5 months 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: device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadList.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java b/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadList.java
similarity index 96%
rename from content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java
rename to device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadList.java
index 6f75214f69e0901dd265e46c2d8f2b38fe877f47..0991f38be92ac4f0d8512077cff2c1c477d3e05a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java
+++ b/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadList.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content.browser.input;
+package org.chromium.device.gamepad;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -16,7 +16,6 @@ import android.view.MotionEvent;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
-import org.chromium.content.browser.ContentView;
/**
* Class to manage connected gamepad devices list.
@@ -24,7 +23,7 @@ import org.chromium.content.browser.ContentView;
* It is a Java counterpart of GamepadPlatformDataFetcherAndroid and feeds Gamepad API with input
* data.
*/
-@JNINamespace("content")
+@JNINamespace("device")
public class GamepadList {
private static final int MAX_GAMEPADS = 4;
@@ -238,8 +237,8 @@ public class GamepadList {
private static boolean isGamepadDevice(InputDevice inputDevice) {
if (inputDevice == null) return false;
- return ((inputDevice.getSources()
- & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK);
+ return ((inputDevice.getSources() & InputDevice.SOURCE_JOYSTICK)
+ == InputDevice.SOURCE_JOYSTICK);
}
private GamepadDevice getGamepadForEvent(InputEvent event) {
@@ -266,8 +265,8 @@ public class GamepadList {
public static boolean isGamepadEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
switch (keyCode) {
- // Specific handling for dpad keys is required because
- // KeyEvent.isGamepadButton doesn't consider dpad keys.
+ // Specific handling for dpad keys is required because
+ // KeyEvent.isGamepadButton doesn't consider dpad keys.
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
@@ -323,5 +322,4 @@ public class GamepadList {
private static class LazyHolder {
private static final GamepadList INSTANCE = new GamepadList();
}
-
}

Powered by Google App Engine
This is Rietveld 408576698