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

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: 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
« no previous file with comments | « device/gamepad/gamepad_shared_buffer.h ('k') | device/gamepad/gamepad_standard_mappings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b924533cdaab85b2e5deb110007e175556df1cf0 100644
--- a/content/browser/gamepad/gamepad_standard_mappings.h
+++ b/device/gamepad/gamepad_standard_mappings.h
@@ -2,13 +2,13 @@
// 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"
+#include "third_party/WebKit/public/platform/WebGamepad.h"
-namespace content {
+namespace device {
typedef void (*GamepadStandardMappingFunction)(
const blink::WebGamepad& original,
@@ -25,7 +25,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 +49,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 +60,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_
« no previous file with comments | « device/gamepad/gamepad_shared_buffer.h ('k') | device/gamepad/gamepad_standard_mappings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698