Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: services/ui/input_devices/touch_device_server.cc

Issue 2901563002: chromeos: adds TouchDeviceServer and wires up in mushrome (Closed)
Patch Set: no temporary Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/input_devices/touch_device_server.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « services/ui/input_devices/touch_device_server.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698