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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/input_devices/touch_device_server.cc
diff --git a/services/ui/input_devices/touch_device_server.cc b/services/ui/input_devices/touch_device_server.cc
new file mode 100644
index 0000000000000000000000000000000000000000..efd88baba92e103fd8f7a41b2b836c601bdb6d4c
--- /dev/null
+++ b/services/ui/input_devices/touch_device_server.cc
@@ -0,0 +1,45 @@
+// 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 "services/ui/input_devices/touch_device_server.h"
+
+#include <utility>
+#include <vector>
+
+#include "services/service_manager/public/cpp/bind_source_info.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
+#include "ui/display/manager/chromeos/default_touch_transform_setter.h"
+#include "ui/events/devices/input_device.h"
+#include "ui/events/devices/touchscreen_device.h"
+
+namespace ui {
+
+TouchDeviceServer::TouchDeviceServer()
+ : touch_transform_setter_(
+ base::MakeUnique<display::DefaultTouchTransformSetter>()) {}
+
+TouchDeviceServer::~TouchDeviceServer() {}
+
+void TouchDeviceServer::AddInterface(
+ service_manager::BinderRegistry* registry) {
+ registry->AddInterface<mojom::TouchDeviceServer>(
+ base::Bind(&TouchDeviceServer::BindTouchDeviceServerRequest,
+ base::Unretained(this)));
+}
+
+void TouchDeviceServer::ConfigureTouchDevices(
+ const std::unordered_map<int32_t, double>& transport_scales,
+ const std::vector<display::TouchDeviceTransform>& transforms) {
+ std::map<int32_t, double> scales(transport_scales.begin(),
+ transport_scales.end());
+ touch_transform_setter_->ConfigureTouchDevices(scales, transforms);
+}
+
+void TouchDeviceServer::BindTouchDeviceServerRequest(
+ const service_manager::BindSourceInfo& source_info,
+ mojom::TouchDeviceServerRequest request) {
+ bindings_.AddBinding(this, std::move(request));
+}
+
+} // namespace ui
« 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