OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_EXO_GAMING_SEAT_H_ | 5 #ifndef COMPONENTS_EXO_GAMING_SEAT_H_ |
6 #define COMPONENTS_EXO_GAMING_SEAT_H_ | 6 #define COMPONENTS_EXO_GAMING_SEAT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ~GamingSeat() override; | 43 ~GamingSeat() override; |
44 | 44 |
45 // Overridden WMHelper::FocusObserver: | 45 // Overridden WMHelper::FocusObserver: |
46 void OnWindowFocused(aura::Window* gained_focus, | 46 void OnWindowFocused(aura::Window* gained_focus, |
47 aura::Window* lost_focus) override; | 47 aura::Window* lost_focus) override; |
48 | 48 |
49 private: | 49 private: |
50 class ThreadSafeGamepadChangeFetcher; | 50 class ThreadSafeGamepadChangeFetcher; |
51 | 51 |
52 // Processes updates of gamepad data and passes changes on to delegate. | 52 // Processes updates of gamepad data and passes changes on to delegate. |
53 void ProcessGamepadChanges(int index, const blink::WebGamepad new_pad); | 53 void ProcessGamepadChanges(int index, const device::Gamepad new_pad); |
54 | 54 |
55 // Private implementation of methods and resources that are used on the | 55 // Private implementation of methods and resources that are used on the |
56 // polling thread. | 56 // polling thread. |
57 scoped_refptr<ThreadSafeGamepadChangeFetcher> gamepad_change_fetcher_; | 57 scoped_refptr<ThreadSafeGamepadChangeFetcher> gamepad_change_fetcher_; |
58 | 58 |
59 // The delegate that handles gamepad_added. | 59 // The delegate that handles gamepad_added. |
60 GamingSeatDelegate* const delegate_; | 60 GamingSeatDelegate* const delegate_; |
61 | 61 |
62 // The delegate instances that all other events are dispatched to. | 62 // The delegate instances that all other events are dispatched to. |
63 GamepadDelegate* gamepad_delegates_[blink::WebGamepads::kItemsLengthCap]; | 63 GamepadDelegate* gamepad_delegates_[device::Gamepads::kItemsLengthCap]; |
64 | 64 |
65 // The current state of the gamepad represented by this instance. | 65 // The current state of the gamepad represented by this instance. |
66 blink::WebGamepads pad_state_; | 66 device::Gamepads pad_state_; |
67 | 67 |
68 // ThreadChecker for the origin thread. | 68 // ThreadChecker for the origin thread. |
69 base::ThreadChecker thread_checker_; | 69 base::ThreadChecker thread_checker_; |
70 | 70 |
71 base::WeakPtrFactory<GamingSeat> weak_ptr_factory_; | 71 base::WeakPtrFactory<GamingSeat> weak_ptr_factory_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(GamingSeat); | 73 DISALLOW_COPY_AND_ASSIGN(GamingSeat); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace exo | 76 } // namespace exo |
77 | 77 |
78 #endif // COMPONENTS_EXO_GAMING_SEAT_H_ | 78 #endif // COMPONENTS_EXO_GAMING_SEAT_H_ |
OLD | NEW |