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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/touch_transform_setter_mus.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/touch_transform_setter_mus.cc
diff --git a/ash/mus/touch_transform_setter_mus.cc b/ash/mus/touch_transform_setter_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f84ade986c9fb7fdab47a617d1ee5a4e695d5996
--- /dev/null
+++ b/ash/mus/touch_transform_setter_mus.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/mus/touch_transform_setter_mus.h"
+
+#include "services/service_manager/public/cpp/connector.h"
+#include "services/ui/public/interfaces/constants.mojom.h"
+#include "ui/display/manager/chromeos/mojo/touch_device_transform_struct_traits.h"
+#include "ui/display/manager/chromeos/touch_device_transform.h"
+
+namespace ash {
+
+TouchTransformSetterMus::TouchTransformSetterMus(
+ service_manager::Connector* connector) {
+ if (!connector)
+ return;
+
+ connector->BindInterface(ui::mojom::kServiceName, &touch_device_server_);
+}
+
+TouchTransformSetterMus::~TouchTransformSetterMus() {}
+
+void TouchTransformSetterMus::ConfigureTouchDevices(
+ const std::map<int32_t, double>& scales,
+ const std::vector<display::TouchDeviceTransform>& transforms) {
+ if (!touch_device_server_)
+ return; // May be null in tests.
+
+ std::unordered_map<int32_t, double> scales_transport(scales.begin(),
+ scales.end());
+ touch_device_server_->ConfigureTouchDevices(scales_transport, transforms);
+}
+
+} // namespace ash
« 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