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

Unified Diff: components/exo/gaming_seat_joydev.h

Issue 2900773003: Allow gaming_seat to use ozone gamepad as back-end (Closed)
Patch Set: Add gaming_seat_ozone to exo Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/exo/gaming_seat_joydev.h
diff --git a/components/exo/gaming_seat.h b/components/exo/gaming_seat_joydev.h
similarity index 71%
copy from components/exo/gaming_seat.h
copy to components/exo/gaming_seat_joydev.h
index 40e44ae33352eeb4cf86c473177ce37d6e52c548..fde65a05ed3212197677982c7e42b99487e7b941 100644
--- a/components/exo/gaming_seat.h
+++ b/components/exo/gaming_seat_joydev.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_EXO_GAMING_SEAT_H_
-#define COMPONENTS_EXO_GAMING_SEAT_H_
+#ifndef COMPONENTS_EXO_GAMING_SEAT_JOYDEV_H_
+#define COMPONENTS_EXO_GAMING_SEAT_JOYDEV_H_
#include <memory>
@@ -13,6 +13,7 @@
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/exo/gaming_seat.h"
#include "components/exo/wm_helper.h"
#include "device/gamepad/gamepad_data_fetcher.h"
#include "ui/aura/client/focus_change_observer.h"
@@ -26,21 +27,21 @@ using CreateGamepadDataFetcherCallback =
// This class represents one gaming seat, it uses a background thread
// for polling gamepad devices and notifies the corresponding GampadDelegate of
-// any changes.
-class GamingSeat : public WMHelper::FocusObserver {
+// any changes. This gaming seat read gamepad events from joydev interface.
+class GamingSeatJoydev : public GamingSeat {
public:
// This class will post tasks to invoke the delegate on the thread runner
// which is associated with the thread that is creating this instance.
- GamingSeat(GamingSeatDelegate* gaming_seat_delegate,
- base::SingleThreadTaskRunner* polling_task_runner);
+ GamingSeatJoydev(GamingSeatDelegate* gaming_seat_delegate,
+ base::SingleThreadTaskRunner* polling_task_runner);
// Allows test cases to specify a CreateGamepadDataFetcherCallback that
// overrides the default GamepadPlatformDataFetcher.
- GamingSeat(GamingSeatDelegate* gaming_seat_delegate,
- base::SingleThreadTaskRunner* polling_task_runner,
- CreateGamepadDataFetcherCallback create_fetcher_callback);
+ GamingSeatJoydev(GamingSeatDelegate* gaming_seat_delegate,
+ base::SingleThreadTaskRunner* polling_task_runner,
+ CreateGamepadDataFetcherCallback create_fetcher_callback);
- ~GamingSeat() override;
+ ~GamingSeatJoydev() override;
// Overridden WMHelper::FocusObserver:
void OnWindowFocused(aura::Window* gained_focus,
@@ -66,13 +67,13 @@ class GamingSeat : public WMHelper::FocusObserver {
device::Gamepads pad_state_;
// ThreadChecker for the origin thread.
- base::ThreadChecker thread_checker_;
+ THREAD_CHECKER(thread_checker_);
- base::WeakPtrFactory<GamingSeat> weak_ptr_factory_;
+ base::WeakPtrFactory<GamingSeatJoydev> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(GamingSeat);
+ DISALLOW_COPY_AND_ASSIGN(GamingSeatJoydev);
};
} // namespace exo
-#endif // COMPONENTS_EXO_GAMING_SEAT_H_
+#endif // COMPONENTS_EXO_GAMING_SEAT_JOYDEV_H_

Powered by Google App Engine
This is Rietveld 408576698