| 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 #include "services/ui/input_devices/touch_device_server.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "services/service_manager/public/cpp/bind_source_info.h" | |
| 11 #include "services/service_manager/public/cpp/binder_registry.h" | |
| 12 #include "ui/display/manager/chromeos/default_touch_transform_setter.h" | |
| 13 #include "ui/events/devices/input_device.h" | |
| 14 #include "ui/events/devices/touchscreen_device.h" | |
| 15 | |
| 16 namespace ui { | |
| 17 | |
| 18 TouchDeviceServer::TouchDeviceServer() | |
| 19 : touch_transform_setter_( | |
| 20 base::MakeUnique<display::DefaultTouchTransformSetter>()) {} | |
| 21 | |
| 22 TouchDeviceServer::~TouchDeviceServer() {} | |
| 23 | |
| 24 void TouchDeviceServer::AddInterface( | |
| 25 service_manager::BinderRegistry* registry) { | |
| 26 registry->AddInterface<mojom::TouchDeviceServer>( | |
| 27 base::Bind(&TouchDeviceServer::BindTouchDeviceServerRequest, | |
| 28 base::Unretained(this))); | |
| 29 } | |
| 30 | |
| 31 void TouchDeviceServer::ConfigureTouchDevices( | |
| 32 const std::unordered_map<int32_t, double>& transport_scales, | |
| 33 const std::vector<display::TouchDeviceTransform>& transforms) { | |
| 34 std::map<int32_t, double> scales(transport_scales.begin(), | |
| 35 transport_scales.end()); | |
| 36 touch_transform_setter_->ConfigureTouchDevices(scales, transforms); | |
| 37 } | |
| 38 | |
| 39 void TouchDeviceServer::BindTouchDeviceServerRequest( | |
| 40 const service_manager::BindSourceInfo& source_info, | |
| 41 mojom::TouchDeviceServerRequest request) { | |
| 42 bindings_.AddBinding(this, std::move(request)); | |
| 43 } | |
| 44 | |
| 45 } // namespace ui | |
| OLD | NEW |