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

Side by Side Diff: content/browser/gamepad/platform_data_fetcher_mac.h

Issue 8899017: Add gamepad data fetcher for Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again, bots all updated Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ 5 #ifndef CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_
6 #define CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ 6 #define CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "content/browser/gamepad/data_fetcher.h" 12 #include "content/browser/gamepad/data_fetcher.h"
13 #include "content/common/gamepad_hardware_buffer.h" 13 #include "content/common/gamepad_hardware_buffer.h"
14 14
15 #include <CoreFoundation/CoreFoundation.h> 15 #include <CoreFoundation/CoreFoundation.h>
16 #include <IOKit/hid/IOHIDManager.h> 16 #include <IOKit/hid/IOHIDManager.h>
17 17
18 #if defined(__OBJC__) 18 #if defined(__OBJC__)
19 @class NSArray; 19 @class NSArray;
20 #else 20 #else
21 class NSArray; 21 class NSArray;
22 #endif 22 #endif
23 23
24 namespace content { 24 namespace content {
25 25
26 class GamepadDataFetcherMac : public GamepadDataFetcher { 26 class GamepadPlatformDataFetcherMac : public GamepadDataFetcher {
27 public: 27 public:
28 GamepadDataFetcherMac(); 28 GamepadPlatformDataFetcherMac();
29 virtual ~GamepadDataFetcherMac(); 29 virtual ~GamepadPlatformDataFetcherMac();
30 virtual void GetGamepadData(WebKit::WebGamepads* pads, 30 virtual void GetGamepadData(WebKit::WebGamepads* pads,
31 bool devices_changed_hint) OVERRIDE; 31 bool devices_changed_hint) OVERRIDE;
32 virtual void PauseHint(bool paused) OVERRIDE; 32 virtual void PauseHint(bool paused) OVERRIDE;
33 private: 33 private:
34 bool enabled_; 34 bool enabled_;
35 base::mac::ScopedCFTypeRef<IOHIDManagerRef> hid_manager_ref_; 35 base::mac::ScopedCFTypeRef<IOHIDManagerRef> hid_manager_ref_;
36 36
37 static GamepadDataFetcherMac* InstanceFromContext(void* context); 37 static GamepadPlatformDataFetcherMac* InstanceFromContext(void* context);
38 static void DeviceAddCallback(void* context, 38 static void DeviceAddCallback(void* context,
39 IOReturn result, 39 IOReturn result,
40 void* sender, 40 void* sender,
41 IOHIDDeviceRef ref); 41 IOHIDDeviceRef ref);
42 static void DeviceRemoveCallback(void* context, 42 static void DeviceRemoveCallback(void* context,
43 IOReturn result, 43 IOReturn result,
44 void* sender, 44 void* sender,
45 IOHIDDeviceRef ref); 45 IOHIDDeviceRef ref);
46 static void ValueChangedCallback(void* context, 46 static void ValueChangedCallback(void* context,
47 IOReturn result, 47 IOReturn result,
(...skipping 18 matching lines...) Expand all
66 IOHIDElementRef axis_elements[WebKit::WebGamepad::buttonsLengthCap]; 66 IOHIDElementRef axis_elements[WebKit::WebGamepad::buttonsLengthCap];
67 CFIndex axis_minimums[WebKit::WebGamepad::axesLengthCap]; 67 CFIndex axis_minimums[WebKit::WebGamepad::axesLengthCap];
68 CFIndex axis_maximums[WebKit::WebGamepad::axesLengthCap]; 68 CFIndex axis_maximums[WebKit::WebGamepad::axesLengthCap];
69 }; 69 };
70 AssociatedData associated_[WebKit::WebGamepads::itemsLengthCap]; 70 AssociatedData associated_[WebKit::WebGamepads::itemsLengthCap];
71 }; 71 };
72 72
73 } // namespace content 73 } // namespace content
74 74
75 #endif // CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_ 75 #endif // CONTENT_BROWSER_GAMEPAD_DATA_FETCHER_MAC_H_
OLDNEW
« no previous file with comments | « content/browser/gamepad/platform_data_fetcher_linux.cc ('k') | content/browser/gamepad/platform_data_fetcher_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698