Index: components/arc/arc_bridge_service.h |
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h |
index 9c1bb4ef6a568d99dd708a1e3924d55ac15a8ef9..15ae124fcd7eaa2ee4b2aa96f8ece579e6ee3528 100644 |
--- a/components/arc/arc_bridge_service.h |
+++ b/components/arc/arc_bridge_service.h |
@@ -9,11 +9,11 @@ |
#include "base/observer_list_threadsafe.h" |
#include "base/sequenced_task_runner.h" |
#include "chromeos/dbus/dbus_method_call_status.h" |
+#include "components/arc/arc_bridge_input_devices.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "ipc/ipc_channel_proxy.h" |
#include "ipc/ipc_listener.h" |
#include "ipc/ipc_message.h" |
- |
class PrefRegistrySimple; |
class PrefService; |
@@ -101,14 +101,8 @@ class ArcBridgeService : public KeyedService, |
// Gets if the bridge is enabled for this session. |
bool IsEnabled() const { return enabled_; } |
- // 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. |
- 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 arc::ArcBridgeTest; |
@@ -145,6 +139,18 @@ class ArcBridgeService : public KeyedService, |
void OnInstanceStarted(chromeos::DBusMethodCallStatus status); |
void OnInstanceStopped(chromeos::DBusMethodCallStatus status); |
+ // 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, |
+ const std::string& device_type); |
+ |
+ // Register all bridge input devices with the ARC instance. Called |
+ // once the instance is ready. |
+ void SetupBridgeInputDevices(); |
+ |
// Thread in which IPC messaging is performed. |
base::Thread ipc_thread_; |
@@ -169,9 +175,13 @@ class ArcBridgeService : public KeyedService, |
// The current state of the bridge. |
ArcBridgeService::State state_; |
+ // List of bridge input devices registered with the ARC instance. |
+ ScopedVector<BridgeInputDevice> bridge_devices_; |
+ |
// WeakPtrFactory to use callbacks. |
base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
+ |
elijahtaylor1
2015/11/02 22:30:29
nit: whitespace
|
DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
}; |