OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "device/gamepad/xbox_data_fetcher_mac.h" | 5 #include "device/gamepad/xbox_data_fetcher_mac.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 UnregisterFromNotifications(); | 617 UnregisterFromNotifications(); |
618 } | 618 } |
619 | 619 |
620 GamepadSource XboxDataFetcher::source() { | 620 GamepadSource XboxDataFetcher::source() { |
621 return Factory::static_source(); | 621 return Factory::static_source(); |
622 } | 622 } |
623 | 623 |
624 void XboxDataFetcher::GetGamepadData(bool devices_changed_hint) { | 624 void XboxDataFetcher::GetGamepadData(bool devices_changed_hint) { |
625 // This just loops through all the connected pads and "pings" them to indicate | 625 // This just loops through all the connected pads and "pings" them to indicate |
626 // that they're still active. | 626 // that they're still active. |
627 for (const auto& controller : controllers_) { | 627 for (auto* controller : controllers_) { |
628 GetPadState(controller->location_id()); | 628 GetPadState(controller->location_id()); |
629 } | 629 } |
630 } | 630 } |
631 | 631 |
632 void XboxDataFetcher::OnAddedToProvider() { | 632 void XboxDataFetcher::OnAddedToProvider() { |
633 RegisterForNotifications(); | 633 RegisterForNotifications(); |
634 } | 634 } |
635 | 635 |
636 void XboxDataFetcher::DeviceAdded(void* context, io_iterator_t iterator) { | 636 void XboxDataFetcher::DeviceAdded(void* context, io_iterator_t iterator) { |
637 DCHECK(context); | 637 DCHECK(context); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 } | 830 } |
831 | 831 |
832 pad.timestamp = base::TimeTicks::Now().ToInternalValue(); | 832 pad.timestamp = base::TimeTicks::Now().ToInternalValue(); |
833 } | 833 } |
834 | 834 |
835 void XboxDataFetcher::XboxControllerError(XboxController* controller) { | 835 void XboxDataFetcher::XboxControllerError(XboxController* controller) { |
836 RemoveController(controller); | 836 RemoveController(controller); |
837 } | 837 } |
838 | 838 |
839 } // namespace device | 839 } // namespace device |
OLD | NEW |