OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_ARC_INPUT_ARC_INPUT_BRIDGE_H_ |
| 6 #define COMPONENTS_EXO_ARC_INPUT_ARC_INPUT_BRIDGE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/arc/arc_bridge_service.h" |
| 10 |
| 11 namespace arc { |
| 12 |
| 13 class ArcBridgeService; |
| 14 |
| 15 // The ArcInputBridge is responsible for sending input events from ARC windows |
| 16 // to the ARC instance. |
| 17 // It hooks into aura::Env to watch for ExoSurface windows that are running ARC |
| 18 // applications. On those windows the input bridge will attach an EventPreTarget |
| 19 // to capture all input events. |
| 20 // To send those events to the ARC instance it will create bridge input devices |
| 21 // through the ArcBridgeService, which will provide a file descriptor to which |
| 22 // we can send linux input_event's. |
| 23 // ui::Events to the ARC windows are translated to linux input_event's, which |
| 24 // are then sent through the respective file descriptor. |
| 25 class ArcInputBridge { |
| 26 public: |
| 27 virtual ~ArcInputBridge() {} |
| 28 |
| 29 // Creates a new instance of ArcInputBridge. It will register an Observer |
| 30 // with aura::Env and the ArcBridgeService. |
| 31 static scoped_ptr<ArcInputBridge> Create( |
| 32 ArcBridgeService* arc_bridge_service); |
| 33 |
| 34 protected: |
| 35 ArcInputBridge() {} |
| 36 |
| 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(ArcInputBridge); |
| 39 }; |
| 40 |
| 41 } // namespace arc |
| 42 |
| 43 #endif // COMPONENTS_EXO_ARC_INPUT_ARC_INPUT_BRIDGE_H_ |
OLD | NEW |