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

Unified Diff: device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadMappings.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: Next attempt Created 4 years, 6 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/GamepadMappings.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/GamepadMappings.java b/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadMappings.java
similarity index 92%
rename from content/public/android/java/src/org/chromium/content/browser/input/GamepadMappings.java
rename to device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadMappings.java
index 1ded67f0bddd1465d72c7892f92614398ec34f68..ee031a20fe05e475a0ac6394a1a643ef678c6977 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/GamepadMappings.java
+++ b/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadMappings.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.view.KeyEvent;
import android.view.MotionEvent;
@@ -60,8 +60,7 @@ class GamepadMappings {
mappedButtons[CanonicalButtonIndex.QUATERNARY] = y;
}
- private static void mapCommonStartSelectMetaButtons(
- float[] mappedButtons, float[] rawButtons) {
+ private static void mapCommonStartSelectMetaButtons(float[] mappedButtons, float[] rawButtons) {
float start = rawButtons[KeyEvent.KEYCODE_BUTTON_START];
float select = rawButtons[KeyEvent.KEYCODE_BUTTON_SELECT];
float mode = rawButtons[KeyEvent.KEYCODE_BUTTON_MODE];
@@ -178,8 +177,8 @@ class GamepadMappings {
* Method for mapping Nvidia gamepad axis and button values
* to standard gamepad button and axes values.
*/
- private static void mapShieldGamepad(float[] mappedButtons, float[] rawButtons,
- float[] mappedAxes, float[] rawAxes) {
+ private static void mapShieldGamepad(
+ float[] mappedButtons, float[] rawButtons, float[] mappedAxes, float[] rawAxes) {
mapCommonXYABButtons(mappedButtons, rawButtons);
mapTriggerButtonsToTopShoulder(mappedButtons, rawButtons);
mapCommonThumbstickButtons(mappedButtons, rawButtons);
@@ -195,14 +194,14 @@ class GamepadMappings {
* Method for mapping Microsoft XBox 360 gamepad axis and button values
* to standard gamepad button and axes values.
*/
- private static void mapXBox360Gamepad(float[] mappedButtons, float[] rawButtons,
- float[] mappedAxes, float[] rawAxes) {
+ private static void mapXBox360Gamepad(
+ float[] mappedButtons, float[] rawButtons, float[] mappedAxes, float[] rawAxes) {
// These are actually mapped the same way in Android.
mapShieldGamepad(mappedButtons, rawButtons, mappedAxes, rawAxes);
}
- private static void mapPS3SixAxisGamepad(float[] mappedButtons, float[] rawButtons,
- float[] mappedAxes, float[] rawAxes) {
+ private static void mapPS3SixAxisGamepad(
+ float[] mappedButtons, float[] rawButtons, float[] mappedAxes, float[] rawAxes) {
// On PS3 X/Y has higher priority.
float a = rawButtons[KeyEvent.KEYCODE_BUTTON_A];
float b = rawButtons[KeyEvent.KEYCODE_BUTTON_B];
@@ -223,8 +222,8 @@ class GamepadMappings {
mapZAndRZAxesToRightStick(mappedAxes, rawAxes);
}
- private static void mapSamsungEIGP20Gamepad(float[] mappedButtons, float[] rawButtons,
- float[] mappedAxes, float[] rawAxes) {
+ private static void mapSamsungEIGP20Gamepad(
+ float[] mappedButtons, float[] rawButtons, float[] mappedAxes, float[] rawAxes) {
mapCommonXYABButtons(mappedButtons, rawButtons);
mapCommonTriggerButtons(mappedButtons, rawButtons);
mapCommonThumbstickButtons(mappedButtons, rawButtons);
@@ -239,8 +238,8 @@ class GamepadMappings {
* Method for mapping Unkown gamepad axis and button values
* to standard gamepad button and axes values.
*/
- private static void mapUnknownGamepad(float[] mappedButtons, float[] rawButtons,
- float[] mappedAxes, float[] rawAxes) {
+ private static void mapUnknownGamepad(
+ float[] mappedButtons, float[] rawButtons, float[] mappedAxes, float[] rawAxes) {
mapCommonXYABButtons(mappedButtons, rawButtons);
mapCommonTriggerButtons(mappedButtons, rawButtons);
mapCommonThumbstickButtons(mappedButtons, rawButtons);

Powered by Google App Engine
This is Rietveld 408576698