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 SERVICES_UI_INPUT_DEVICES_TOUCH_DEVICE_SERVER_H_ |
| 6 #define SERVICES_UI_INPUT_DEVICES_TOUCH_DEVICE_SERVER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding_set.h" |
| 10 #include "mojo/public/cpp/bindings/interface_ptr_set.h" |
| 11 #include "services/ui/public/interfaces/input_devices/touch_device_server.mojom.
h" |
| 12 |
| 13 namespace display { |
| 14 class DefaultTouchTransformSetter; |
| 15 } |
| 16 |
| 17 namespace service_manager { |
| 18 class BinderRegistry; |
| 19 struct BindSourceInfo; |
| 20 } |
| 21 |
| 22 namespace ui { |
| 23 |
| 24 // Implementation of mojom::TouchDeviceServer. Uses an instance of |
| 25 // DefaultTouchTransformSetter to apply the actual updates. |
| 26 class TouchDeviceServer : public mojom::TouchDeviceServer { |
| 27 public: |
| 28 TouchDeviceServer(); |
| 29 ~TouchDeviceServer() override; |
| 30 |
| 31 // Adds interface with the connection registry so remote observers can |
| 32 // connect. |
| 33 void AddInterface(service_manager::BinderRegistry* registry); |
| 34 |
| 35 // mojom::TouchDeviceServer: |
| 36 void ConfigureTouchDevices( |
| 37 const std::unordered_map<int32_t, double>& transport_scales, |
| 38 const std::vector<display::TouchDeviceTransform>& transforms) override; |
| 39 |
| 40 private: |
| 41 void BindTouchDeviceServerRequest( |
| 42 const service_manager::BindSourceInfo& source_info, |
| 43 mojom::TouchDeviceServerRequest request); |
| 44 |
| 45 mojo::BindingSet<mojom::TouchDeviceServer> bindings_; |
| 46 std::unique_ptr<display::DefaultTouchTransformSetter> touch_transform_setter_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(TouchDeviceServer); |
| 49 }; |
| 50 |
| 51 } // namespace ui |
| 52 |
| 53 #endif // SERVICES_UI_INPUT_DEVICES_TOUCH_DEVICE_SERVER_H_ |
OLD | NEW |