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

Unified Diff: content/browser/gamepad/gamepad_platform_data_fetcher_mac.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
Index: content/browser/gamepad/gamepad_platform_data_fetcher_mac.h
diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h b/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h
deleted file mode 100644
index 254ebb5ca8f6a65c29f8011cdeb6855f580159f3..0000000000000000000000000000000000000000
--- a/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// 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_PLATFORM_DATA_FETCHER_MAC_H_
-#define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <IOKit/hid/IOHIDManager.h>
-#include <stddef.h>
-
-#include <memory>
-
-#include "base/compiler_specific.h"
-#include "base/mac/scoped_cftyperef.h"
-#include "base/macros.h"
-#include "build/build_config.h"
-#include "content/browser/gamepad/gamepad_data_fetcher.h"
-#include "content/browser/gamepad/xbox_data_fetcher_mac.h"
-#include "content/common/gamepad_hardware_buffer.h"
-
-#if defined(__OBJC__)
-@class NSArray;
-#else
-class NSArray;
-#endif
-
-namespace content {
-
-class GamepadPlatformDataFetcherMac : public GamepadDataFetcher,
- public XboxDataFetcher::Delegate {
- public:
- GamepadPlatformDataFetcherMac();
- ~GamepadPlatformDataFetcherMac() override;
- void GetGamepadData(blink::WebGamepads* pads,
- bool devices_changed_hint) override;
- void PauseHint(bool paused) override;
-
- private:
- bool enabled_;
- bool paused_;
- base::ScopedCFTypeRef<IOHIDManagerRef> hid_manager_ref_;
-
- static GamepadPlatformDataFetcherMac* InstanceFromContext(void* context);
- static void DeviceAddCallback(void* context,
- IOReturn result,
- void* sender,
- IOHIDDeviceRef ref);
- static void DeviceRemoveCallback(void* context,
- IOReturn result,
- void* sender,
- IOHIDDeviceRef ref);
- static void ValueChangedCallback(void* context,
- IOReturn result,
- void* sender,
- IOHIDValueRef ref);
-
- size_t GetEmptySlot();
- size_t GetSlotForDevice(IOHIDDeviceRef device);
- size_t GetSlotForXboxDevice(XboxController* device);
-
- void DeviceAdd(IOHIDDeviceRef device);
- bool CheckCollection(IOHIDElementRef element);
- bool AddButtonsAndAxes(NSArray* elements, size_t slot);
- void DeviceRemove(IOHIDDeviceRef device);
- void ValueChanged(IOHIDValueRef value);
-
- void XboxDeviceAdd(XboxController* device) override;
- void XboxDeviceRemove(XboxController* device) override;
- void XboxValueChanged(XboxController* device,
- const XboxController::Data& data) override;
-
- void RegisterForNotifications();
- void UnregisterFromNotifications();
-
- void SanitizeGamepadData(size_t index, blink::WebGamepad* pad);
-
- std::unique_ptr<XboxDataFetcher> xbox_fetcher_;
-
- // Side-band data that's not passed to the consumer, but we need to maintain
- // to update data_.
- struct AssociatedData {
- bool is_xbox;
- union {
- struct {
- IOHIDDeviceRef device_ref;
- IOHIDElementRef button_elements[blink::WebGamepad::buttonsLengthCap];
- IOHIDElementRef axis_elements[blink::WebGamepad::axesLengthCap];
- CFIndex axis_minimums[blink::WebGamepad::axesLengthCap];
- CFIndex axis_maximums[blink::WebGamepad::axesLengthCap];
- CFIndex axis_report_sizes[blink::WebGamepad::axesLengthCap];
- } hid;
- struct {
- XboxController* device;
- UInt32 location_id;
- } xbox;
- };
- };
- AssociatedData associated_[blink::WebGamepads::itemsLengthCap];
-
- DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherMac);
-};
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698