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

Unified Diff: device/gamepad/gamepad_standard_mappings.h

Issue 2081583002: Migrating majority of gamepad from content/browser/ to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android and Unit tests 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/gamepad_standard_mappings.h
diff --git a/content/browser/gamepad/gamepad_standard_mappings.h b/device/gamepad/gamepad_standard_mappings.h
similarity index 77%
rename from content/browser/gamepad/gamepad_standard_mappings.h
rename to device/gamepad/gamepad_standard_mappings.h
index d4908eff44200f5702da773a9de35aa234158392..574795a01016b0f4438c3d31ad4a345434073ae2 100644
--- a/content/browser/gamepad/gamepad_standard_mappings.h
+++ b/device/gamepad/gamepad_standard_mappings.h
@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
-#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
+#ifndef DEVICE_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
+#define DEVICE_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
#include "base/strings/string_piece.h"
-#include "content/common/gamepad_hardware_buffer.h"
-
-namespace content {
+#include "third_party/WebKit/public/platform/WebGamepad.h"
+namespace device {
scottmg 2016/06/23 17:27:19 \n before
typedef void (*GamepadStandardMappingFunction)(
const blink::WebGamepad& original,
@@ -25,7 +24,7 @@ GamepadStandardMappingFunction GetGamepadStandardMappingFunction(
// appropriately.
// A Java counterpart will be generated for this enum.
-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.browser.input
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.gamepad
// GENERATED_JAVA_PREFIX_TO_STRIP: BUTTON_INDEX_
enum CanonicalButtonIndex {
BUTTON_INDEX_PRIMARY,
@@ -49,7 +48,7 @@ enum CanonicalButtonIndex {
};
// A Java counterpart will be generated for this enum.
-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.browser.input
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.gamepad
// GENERATED_JAVA_PREFIX_TO_STRIP: AXIS_INDEX_
enum CanonicalAxisIndex {
AXIS_INDEX_LEFT_STICK_X,
@@ -60,17 +59,17 @@ enum CanonicalAxisIndex {
};
// Matches XInput's trigger deadzone
-const float kDefaultButtonPressedThreshold = 30.f/255.f;
+const float kDefaultButtonPressedThreshold = 30.f / 255.f;
// Common mapping functions
blink::WebGamepadButton AxisToButton(float input);
blink::WebGamepadButton AxisNegativeAsButton(float input);
blink::WebGamepadButton AxisPositiveAsButton(float input);
-blink::WebGamepadButton ButtonFromButtonAndAxis(
- blink::WebGamepadButton button, float axis);
+blink::WebGamepadButton ButtonFromButtonAndAxis(blink::WebGamepadButton button,
+ float axis);
blink::WebGamepadButton NullButton();
void DpadFromAxis(blink::WebGamepad* mapped, float dir);
-} // namespace content
+} // namespace device
-#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
+#endif // DEVICE_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_

Powered by Google App Engine
This is Rietveld 408576698