Index: device/gamepad/gamepad_standard_mappings.cc |
diff --git a/content/browser/gamepad/gamepad_standard_mappings.cc b/device/gamepad/gamepad_standard_mappings.cc |
similarity index 78% |
rename from content/browser/gamepad/gamepad_standard_mappings.cc |
rename to device/gamepad/gamepad_standard_mappings.cc |
index 687d4ce154d5e6a0303a9b64b9210bef65aa5da8..d76d06dd9f273648fe5955b42719ad43fd958c88 100644 |
--- a/content/browser/gamepad/gamepad_standard_mappings.cc |
+++ b/device/gamepad/gamepad_standard_mappings.cc |
@@ -2,30 +2,27 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "content/browser/gamepad/gamepad_standard_mappings.h" |
+#include "device/gamepad/gamepad_standard_mappings.h" |
-namespace content { |
+namespace device { |
blink::WebGamepadButton AxisToButton(float input) { |
float value = (input + 1.f) / 2.f; |
- return blink::WebGamepadButton( |
- value > kDefaultButtonPressedThreshold, value); |
+ return blink::WebGamepadButton(value > kDefaultButtonPressedThreshold, value); |
} |
blink::WebGamepadButton AxisNegativeAsButton(float input) { |
float value = (input < -0.5f) ? 1.f : 0.f; |
- return blink::WebGamepadButton( |
- value > kDefaultButtonPressedThreshold, value); |
+ return blink::WebGamepadButton(value > kDefaultButtonPressedThreshold, value); |
} |
blink::WebGamepadButton AxisPositiveAsButton(float input) { |
float value = (input > 0.5f) ? 1.f : 0.f; |
- return blink::WebGamepadButton( |
- value > kDefaultButtonPressedThreshold, value); |
+ return blink::WebGamepadButton(value > kDefaultButtonPressedThreshold, value); |
} |
-blink::WebGamepadButton ButtonFromButtonAndAxis( |
- blink::WebGamepadButton button, float axis) { |
+blink::WebGamepadButton ButtonFromButtonAndAxis(blink::WebGamepadButton button, |
+ float axis) { |
float value = (axis + 1.f) / 2.f; |
return blink::WebGamepadButton(button.pressed, value); |
} |
@@ -61,4 +58,4 @@ void DpadFromAxis(blink::WebGamepad* mapped, float dir) { |
mapped->buttons[BUTTON_INDEX_DPAD_LEFT].value = left ? 1.f : 0.f; |
} |
-} // namespace content |
+} // namespace device |