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

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

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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) 2012 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_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_ 5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_ 6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
(...skipping 14 matching lines...) Expand all
25 class NSArray; 25 class NSArray;
26 #endif 26 #endif
27 27
28 namespace content { 28 namespace content {
29 29
30 class GamepadPlatformDataFetcherMac : public GamepadDataFetcher, 30 class GamepadPlatformDataFetcherMac : public GamepadDataFetcher,
31 public XboxDataFetcher::Delegate { 31 public XboxDataFetcher::Delegate {
32 public: 32 public:
33 GamepadPlatformDataFetcherMac(); 33 GamepadPlatformDataFetcherMac();
34 virtual ~GamepadPlatformDataFetcherMac(); 34 virtual ~GamepadPlatformDataFetcherMac();
35 virtual void GetGamepadData(WebKit::WebGamepads* pads, 35 virtual void GetGamepadData(blink::WebGamepads* pads,
36 bool devices_changed_hint) OVERRIDE; 36 bool devices_changed_hint) OVERRIDE;
37 virtual void PauseHint(bool paused) OVERRIDE; 37 virtual void PauseHint(bool paused) OVERRIDE;
38 38
39 private: 39 private:
40 bool enabled_; 40 bool enabled_;
41 base::ScopedCFTypeRef<IOHIDManagerRef> hid_manager_ref_; 41 base::ScopedCFTypeRef<IOHIDManagerRef> hid_manager_ref_;
42 42
43 static GamepadPlatformDataFetcherMac* InstanceFromContext(void* context); 43 static GamepadPlatformDataFetcherMac* InstanceFromContext(void* context);
44 static void DeviceAddCallback(void* context, 44 static void DeviceAddCallback(void* context,
45 IOReturn result, 45 IOReturn result,
(...skipping 20 matching lines...) Expand all
66 virtual void XboxDeviceAdd(XboxController* device) OVERRIDE; 66 virtual void XboxDeviceAdd(XboxController* device) OVERRIDE;
67 virtual void XboxDeviceRemove(XboxController* device) OVERRIDE; 67 virtual void XboxDeviceRemove(XboxController* device) OVERRIDE;
68 virtual void XboxValueChanged(XboxController* device, 68 virtual void XboxValueChanged(XboxController* device,
69 const XboxController::Data& data) OVERRIDE; 69 const XboxController::Data& data) OVERRIDE;
70 70
71 void RegisterForNotifications(); 71 void RegisterForNotifications();
72 void UnregisterFromNotifications(); 72 void UnregisterFromNotifications();
73 73
74 scoped_ptr<XboxDataFetcher> xbox_fetcher_; 74 scoped_ptr<XboxDataFetcher> xbox_fetcher_;
75 75
76 WebKit::WebGamepads data_; 76 blink::WebGamepads data_;
77 77
78 // Side-band data that's not passed to the consumer, but we need to maintain 78 // Side-band data that's not passed to the consumer, but we need to maintain
79 // to update data_. 79 // to update data_.
80 struct AssociatedData { 80 struct AssociatedData {
81 bool is_xbox; 81 bool is_xbox;
82 union { 82 union {
83 struct { 83 struct {
84 IOHIDDeviceRef device_ref; 84 IOHIDDeviceRef device_ref;
85 IOHIDElementRef button_elements[WebKit::WebGamepad::buttonsLengthCap]; 85 IOHIDElementRef button_elements[blink::WebGamepad::buttonsLengthCap];
86 IOHIDElementRef axis_elements[WebKit::WebGamepad::buttonsLengthCap]; 86 IOHIDElementRef axis_elements[blink::WebGamepad::buttonsLengthCap];
87 CFIndex axis_minimums[WebKit::WebGamepad::axesLengthCap]; 87 CFIndex axis_minimums[blink::WebGamepad::axesLengthCap];
88 CFIndex axis_maximums[WebKit::WebGamepad::axesLengthCap]; 88 CFIndex axis_maximums[blink::WebGamepad::axesLengthCap];
89 // Function to map from device data to standard layout, if available. 89 // Function to map from device data to standard layout, if available.
90 // May be null if no mapping is available. 90 // May be null if no mapping is available.
91 GamepadStandardMappingFunction mapper; 91 GamepadStandardMappingFunction mapper;
92 } hid; 92 } hid;
93 struct { 93 struct {
94 XboxController* device; 94 XboxController* device;
95 UInt32 location_id; 95 UInt32 location_id;
96 } xbox; 96 } xbox;
97 }; 97 };
98 }; 98 };
99 AssociatedData associated_[WebKit::WebGamepads::itemsLengthCap]; 99 AssociatedData associated_[blink::WebGamepads::itemsLengthCap];
100 100
101 DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherMac); 101 DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherMac);
102 }; 102 };
103 103
104 } // namespace content 104 } // namespace content
105 105
106 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_ 106 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698