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

Unified Diff: device/gamepad/raw_input_data_fetcher_win.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_user_gesture.cc ('k') | device/gamepad/raw_input_data_fetcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/raw_input_data_fetcher_win.h
diff --git a/content/browser/gamepad/raw_input_data_fetcher_win.h b/device/gamepad/raw_input_data_fetcher_win.h
similarity index 64%
rename from content/browser/gamepad/raw_input_data_fetcher_win.h
rename to device/gamepad/raw_input_data_fetcher_win.h
index b65e6c9b9fa6717bcce51212c499b5987b7d3acf..891a29648f512d2d10c5a3433b16a7007f3b2f75 100644
--- a/content/browser/gamepad/raw_input_data_fetcher_win.h
+++ b/device/gamepad/raw_input_data_fetcher_win.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
-#define CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
+#ifndef DEVICE_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
+#define DEVICE_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
-#include <stdint.h>
-#include <stdlib.h>
#include <Unknwn.h>
#include <WinDef.h>
-#include <windows.h>
#include <hidsdi.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <windows.h>
#include <map>
#include <memory>
@@ -22,11 +22,11 @@
#include "base/scoped_native_library.h"
#include "base/win/message_window.h"
#include "build/build_config.h"
-#include "content/browser/gamepad/gamepad_data_fetcher.h"
-#include "content/browser/gamepad/gamepad_standard_mappings.h"
+#include "device/gamepad/gamepad_data_fetcher.h"
+#include "device/gamepad/gamepad_standard_mappings.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
-namespace content {
+namespace device {
struct RawGamepadAxis {
HIDP_VALUE_CAPS caps;
@@ -56,9 +56,8 @@ struct RawGamepadInfo {
RawGamepadAxis axes[blink::WebGamepad::axesLengthCap];
};
-class RawInputDataFetcher
- : public base::SupportsWeakPtr<RawInputDataFetcher>,
- public base::MessageLoop::DestructionObserver {
+class RawInputDataFetcher : public base::SupportsWeakPtr<RawInputDataFetcher>,
+ public base::MessageLoop::DestructionObserver {
public:
explicit RawInputDataFetcher();
~RawInputDataFetcher() override;
@@ -87,14 +86,19 @@ class RawInputDataFetcher
void ClearControllers();
// Function types we use from hid.dll.
- typedef NTSTATUS (__stdcall *HidPGetCapsFunc)(
- PHIDP_PREPARSED_DATA PreparsedData, PHIDP_CAPS Capabilities);
- typedef NTSTATUS (__stdcall *HidPGetButtonCapsFunc)(
- HIDP_REPORT_TYPE ReportType, PHIDP_BUTTON_CAPS ButtonCaps,
- PUSHORT ButtonCapsLength, PHIDP_PREPARSED_DATA PreparsedData);
- typedef NTSTATUS (__stdcall *HidPGetValueCapsFunc)(
- HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps,
- PUSHORT ValueCapsLength, PHIDP_PREPARSED_DATA PreparsedData);
+ typedef NTSTATUS(__stdcall* HidPGetCapsFunc)(
+ PHIDP_PREPARSED_DATA PreparsedData,
+ PHIDP_CAPS Capabilities);
+ typedef NTSTATUS(__stdcall* HidPGetButtonCapsFunc)(
+ HIDP_REPORT_TYPE ReportType,
+ PHIDP_BUTTON_CAPS ButtonCaps,
+ PUSHORT ButtonCapsLength,
+ PHIDP_PREPARSED_DATA PreparsedData);
+ typedef NTSTATUS(__stdcall* HidPGetValueCapsFunc)(
+ HIDP_REPORT_TYPE ReportType,
+ PHIDP_VALUE_CAPS ValueCaps,
+ PUSHORT ValueCapsLength,
+ PHIDP_PREPARSED_DATA PreparsedData);
typedef NTSTATUS(__stdcall* HidPGetUsagesExFunc)(
HIDP_REPORT_TYPE ReportType,
USHORT LinkCollection,
@@ -103,16 +107,27 @@ class RawInputDataFetcher
PHIDP_PREPARSED_DATA PreparsedData,
PCHAR Report,
ULONG ReportLength);
- typedef NTSTATUS (__stdcall *HidPGetUsageValueFunc)(
- HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USHORT LinkCollection,
- USAGE Usage, PULONG UsageValue, PHIDP_PREPARSED_DATA PreparsedData,
- PCHAR Report, ULONG ReportLength);
- typedef NTSTATUS (__stdcall *HidPGetScaledUsageValueFunc)(
- HIDP_REPORT_TYPE ReportType, USAGE UsagePage, USHORT LinkCollection,
- USAGE Usage, PLONG UsageValue, PHIDP_PREPARSED_DATA PreparsedData,
- PCHAR Report, ULONG ReportLength);
- typedef BOOLEAN (__stdcall *HidDGetStringFunc)(
- HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength);
+ typedef NTSTATUS(__stdcall* HidPGetUsageValueFunc)(
+ HIDP_REPORT_TYPE ReportType,
+ USAGE UsagePage,
+ USHORT LinkCollection,
+ USAGE Usage,
+ PULONG UsageValue,
+ PHIDP_PREPARSED_DATA PreparsedData,
+ PCHAR Report,
+ ULONG ReportLength);
+ typedef NTSTATUS(__stdcall* HidPGetScaledUsageValueFunc)(
+ HIDP_REPORT_TYPE ReportType,
+ USAGE UsagePage,
+ USHORT LinkCollection,
+ USAGE Usage,
+ PLONG UsageValue,
+ PHIDP_PREPARSED_DATA PreparsedData,
+ PCHAR Report,
+ ULONG ReportLength);
+ typedef BOOLEAN(__stdcall* HidDGetStringFunc)(HANDLE HidDeviceObject,
+ PVOID Buffer,
+ ULONG BufferLength);
// Get functions from dynamically loaded hid.dll. Returns true if loading was
// successful.
@@ -139,6 +154,6 @@ class RawInputDataFetcher
DISALLOW_COPY_AND_ASSIGN(RawInputDataFetcher);
};
-} // namespace content
+} // namespace device
-#endif // CONTENT_BROWSER_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
+#endif // DEVICE_GAMEPAD_RAW_INPUT_DATA_FETCHER_WIN_H_
« no previous file with comments | « device/gamepad/gamepad_user_gesture.cc ('k') | device/gamepad/raw_input_data_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698