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

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

Issue 10831292: Use non-exclusive access to gamepad on mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/gamepad/platform_data_fetcher_mac.h" 5 #include "content/browser/gamepad/platform_data_fetcher_mac.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 hid_manager_ref_, 79 hid_manager_ref_,
80 ValueChangedCallback, 80 ValueChangedCallback,
81 this); 81 this);
82 82
83 IOHIDManagerScheduleWithRunLoop( 83 IOHIDManagerScheduleWithRunLoop(
84 hid_manager_ref_, 84 hid_manager_ref_,
85 CFRunLoopGetMain(), 85 CFRunLoopGetMain(),
86 kCFRunLoopDefaultMode); 86 kCFRunLoopDefaultMode);
87 87
88 enabled_ = IOHIDManagerOpen(hid_manager_ref_, 88 enabled_ = IOHIDManagerOpen(hid_manager_ref_,
89 kIOHIDOptionsTypeSeizeDevice) == kIOReturnSuccess; 89 kIOHIDOptionsTypeNone) == kIOReturnSuccess;
90 } 90 }
91 91
92 void GamepadPlatformDataFetcherMac::UnregisterFromNotifications() { 92 void GamepadPlatformDataFetcherMac::UnregisterFromNotifications() {
93 IOHIDManagerUnscheduleFromRunLoop( 93 IOHIDManagerUnscheduleFromRunLoop(
94 hid_manager_ref_, 94 hid_manager_ref_,
95 CFRunLoopGetCurrent(), 95 CFRunLoopGetCurrent(),
96 kCFRunLoopDefaultMode); 96 kCFRunLoopDefaultMode);
97 IOHIDManagerClose(hid_manager_ref_, kIOHIDOptionsTypeNone); 97 IOHIDManagerClose(hid_manager_ref_, kIOHIDOptionsTypeNone);
98 } 98 }
99 99
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 pads->length = data_.length; 304 pads->length = data_.length;
305 for (size_t i = 0; i < WebKit::WebGamepads::itemsLengthCap; ++i) { 305 for (size_t i = 0; i < WebKit::WebGamepads::itemsLengthCap; ++i) {
306 if (associated_[i].mapper) 306 if (associated_[i].mapper)
307 associated_[i].mapper(data_.items[i], &pads->items[i]); 307 associated_[i].mapper(data_.items[i], &pads->items[i]);
308 else 308 else
309 pads->items[i] = data_.items[i]; 309 pads->items[i] = data_.items[i];
310 } 310 }
311 } 311 }
312 312
313 } // namespace content 313 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698