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

Unified Diff: content/browser/gamepad/gamepad_standard_mappings.h

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added compile flag to enable new Blink interface Created 6 years, 10 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: content/browser/gamepad/gamepad_standard_mappings.h
diff --git a/content/browser/gamepad/gamepad_standard_mappings.h b/content/browser/gamepad/gamepad_standard_mappings.h
index 6b533ca5829c01139e70ac73145613772e14c766..4451ea578d1a1fd4e0f6ebbe6977c005bd00070b 100644
--- a/content/browser/gamepad/gamepad_standard_mappings.h
+++ b/content/browser/gamepad/gamepad_standard_mappings.h
@@ -6,10 +6,7 @@
#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_
#include "base/strings/string_piece.h"
-
-namespace blink {
-class WebGamepad;
-}
+#include "content/common/gamepad_hardware_buffer.h"
namespace content {
@@ -56,6 +53,14 @@ enum CanonicalAxisIndex {
kNumAxes
};
+const float default_button_pressed_threshold = 0.1f;
scottmg 2014/02/20 01:15:13 kDefaultButtonPressedThreshold (and possibly shar
+
+// Common mapping functions
+blink::WebGamepadButton AxisToButton(float input);
+blink::WebGamepadButton AxisNegativeAsButton(float input);
+blink::WebGamepadButton AxisPositiveAsButton(float input);
+void DpadFromAxis(blink::WebGamepad* mapped, float dir);
+
} // namespace content
#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_STANDARD_MAPPINGS_H_

Powered by Google App Engine
This is Rietveld 408576698