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

Side by Side Diff: ash/mus/touch_transform_setter_mus.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 | « ash/mus/touch_transform_setter_mus.h ('k') | ash/shell.h » ('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 "ash/mus/touch_transform_setter_mus.h"
6
7 #include "services/service_manager/public/cpp/connector.h"
8 #include "services/ui/public/interfaces/constants.mojom.h"
9 #include "ui/display/manager/chromeos/mojo/touch_device_transform_struct_traits. h"
10 #include "ui/display/manager/chromeos/touch_device_transform.h"
11
12 namespace ash {
13
14 TouchTransformSetterMus::TouchTransformSetterMus(
15 service_manager::Connector* connector) {
16 if (!connector)
17 return;
18
19 connector->BindInterface(ui::mojom::kServiceName, &touch_device_server_);
20 }
21
22 TouchTransformSetterMus::~TouchTransformSetterMus() {}
23
24 void TouchTransformSetterMus::ConfigureTouchDevices(
25 const std::map<int32_t, double>& scales,
26 const std::vector<display::TouchDeviceTransform>& transforms) {
27 if (!touch_device_server_)
28 return; // May be null in tests.
29
30 std::unordered_map<int32_t, double> scales_transport(scales.begin(),
31 scales.end());
32 touch_device_server_->ConfigureTouchDevices(scales_transport, transforms);
33 }
34
35 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/touch_transform_setter_mus.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698