| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_EXO_GAMING_SEAT_OZONE_H_ |
| 6 #define COMPONENTS_EXO_GAMING_SEAT_OZONE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/exo/gaming_seat.h" |
| 12 #include "components/exo/wm_helper.h" |
| 13 #include "ui/events/ozone/gamepad/gamepad_observer.h" |
| 14 |
| 15 namespace ui { |
| 16 class GamepadProviderOzone; |
| 17 } |
| 18 |
| 19 namespace exo { |
| 20 class GamingSeatDelegate; |
| 21 class GamepadDelegate; |
| 22 |
| 23 class GamingSeatOzone : public GamingSeat, public ui::GamepadObserver { |
| 24 public: |
| 25 GamingSeatOzone(GamingSeatDelegate* delegate); |
| 26 |
| 27 ~GamingSeatOzone() override; |
| 28 |
| 29 // Overriden ui::GamepadObserver. |
| 30 void OnGamepadDevicesUpdated() override; |
| 31 void OnGamepadEvent(const ui::GamepadEvent& event) override; |
| 32 |
| 33 // Overridden WMHelper::FocusObserver: |
| 34 void OnWindowFocused(aura::Window* gained_focus, |
| 35 aura::Window* lost_focus) override; |
| 36 |
| 37 private: |
| 38 // Enable or disable this gaming seat. |
| 39 void Enable(bool enable); |
| 40 |
| 41 // The delegate that handles gamepad_added. |
| 42 GamingSeatDelegate* const delegate_; |
| 43 |
| 44 // This map maps device id to gamepad delegates. |
| 45 std::map<int, GamepadDelegate*> gamepads_; |
| 46 |
| 47 ui::GamepadProviderOzone* gamepad_provider_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(GamingSeatOzone); |
| 50 }; |
| 51 |
| 52 } // namespace exo |
| 53 |
| 54 #endif // COMPONENTS_EXO_GAMING_SEAT_JOYDEV_H_ |
| OLD | NEW |