Index: components/arc/arc_bridge_service.h |
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h |
index 77968cec22121f378c6fc90932cc2b6808e75480..1df72e54658492d8a8db850c8bfa58163d9d3f9e 100644 |
--- a/components/arc/arc_bridge_service.h |
+++ b/components/arc/arc_bridge_service.h |
@@ -8,9 +8,11 @@ |
#include "base/macros.h" |
#include "base/observer_list.h" |
#include "base/sequenced_task_runner.h" |
+#include "components/arc/arc_bridge_input_devices.h" |
#include "ipc/ipc_channel_proxy.h" |
#include "ipc/ipc_listener.h" |
#include "ipc/ipc_message.h" |
+#include "ui/events/event.h" |
namespace base { |
class CommandLine; |
@@ -113,15 +115,8 @@ class ArcBridgeService : public IPC::Listener { |
// Gets if ARC is available in this system. |
bool available() const { return available_; } |
- // Requests registration of an input device on the ARC instance. |
- // TODO(denniskempin): Make this interface more typesafe. |
- // |name| should be the displayable name of the emulated device (e.g. "Chrome |
- // OS Keyboard"), |device_type| the name of the device type (e.g. "keyboard") |
- // and |fd| a file descriptor that emulates the kernel events of the device. |
- // This can only be called on the thread that this class was created on. |
- bool RegisterInputDevice(const std::string& name, |
- const std::string& device_type, |
- base::ScopedFD fd); |
+ // Translates and sends input event to the ARC instance. |
+ void SendInputEvent(ui::Event* event); |
private: |
friend class ArcBridgeTest; |
@@ -167,6 +162,22 @@ class ArcBridgeService : public IPC::Listener { |
void OnInstanceStarted(bool success); |
void OnInstanceStopped(bool success); |
+ // Creates and registers an input device on the ARC instance. |
+ // TODO(denniskempin): Make this interface more typesafe. |
+ // |name| should be the displayable name of the emulated device (e.g. "Chrome |
+ // OS Keyboard"), |device_type| the name of the device type (e.g. "keyboard") |
+ // Returns a file descriptor that receives the kernel events of the device. |
+ base::ScopedFD CreateBridgeInputDevice(const std::string& name, |
Luis Héctor Chávez
2015/11/17 17:51:54
I would prefer if the ArcBridgeService did not hav
denniskempin
2015/11/19 19:22:09
done
|
+ const std::string& device_type); |
+ |
+ // Register all bridge input devices with the ARC instance. Called |
+ // once the instance is ready. |
+ void SetupBridgeInputDevices(); |
+ |
+ // List of bridge input devices registered with the ARC instance. |
+ ScopedVector<BridgeInputDevice> bridge_devices_; |
+ |
+ // Task runner on which incoming messages are handled. |
scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; |
scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner_; |
scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |