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

Side by Side Diff: ui/events/ozone/evdev/input_device_factory_evdev_proxy.cc

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2015 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 "ui/events/ozone/evdev/input_device_factory_evdev_proxy.h"
6
7 #include "base/bind.h"
8 #include "base/thread_task_runner_handle.h"
9 #include "ui/events/ozone/evdev/input_device_factory_evdev.h"
10
11 namespace ui {
12
13 namespace {
14
15 void ForwardGetTouchDeviceStatusReply(
16 scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
17 const GetTouchDeviceStatusReply& reply,
18 scoped_ptr<std::string> status) {
19 // Thread hop back to UI for reply.
20 reply_runner->PostTask(FROM_HERE, base::Bind(reply, base::Passed(&status)));
21 }
22
23 void ForwardGetTouchEventLogReply(
24 scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
25 const GetTouchEventLogReply& reply,
26 scoped_ptr<std::vector<base::FilePath>> log_paths) {
27 // Thread hop back to UI for reply.
28 reply_runner->PostTask(FROM_HERE,
29 base::Bind(reply, base::Passed(&log_paths)));
30 }
31
32 } // namespace
33
34 InputDeviceFactoryEvdevProxy::InputDeviceFactoryEvdevProxy(
35 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
36 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory)
37 : task_runner_(task_runner), input_device_factory_(input_device_factory) {
38 }
39
40 InputDeviceFactoryEvdevProxy::~InputDeviceFactoryEvdevProxy() {
41 }
42
43 void InputDeviceFactoryEvdevProxy::AddInputDevice(int id,
44 const base::FilePath& path) {
45 task_runner_->PostTask(FROM_HERE,
46 base::Bind(&InputDeviceFactoryEvdev::AddInputDevice,
47 input_device_factory_, id, path));
48 }
49
50 void InputDeviceFactoryEvdevProxy::RemoveInputDevice(
51 const base::FilePath& path) {
52 task_runner_->PostTask(FROM_HERE,
53 base::Bind(&InputDeviceFactoryEvdev::RemoveInputDevice,
54 input_device_factory_, path));
55 }
56
57 void InputDeviceFactoryEvdevProxy::OnStartupScanComplete() {
58 task_runner_->PostTask(
59 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::OnStartupScanComplete,
60 input_device_factory_));
61 }
62
63 void InputDeviceFactoryEvdevProxy::SetCapsLockLed(bool enabled) {
64 task_runner_->PostTask(FROM_HERE,
65 base::Bind(&InputDeviceFactoryEvdev::SetCapsLockLed,
66 input_device_factory_, enabled));
67 }
68
69 void InputDeviceFactoryEvdevProxy::UpdateInputDeviceSettings(
70 const InputDeviceSettingsEvdev& settings) {
71 task_runner_->PostTask(
72 FROM_HERE, base::Bind(&InputDeviceFactoryEvdev::UpdateInputDeviceSettings,
73 input_device_factory_, settings));
74 }
75
76 void InputDeviceFactoryEvdevProxy::GetTouchDeviceStatus(
77 const GetTouchDeviceStatusReply& reply) {
78 task_runner_->PostTask(
79 FROM_HERE,
80 base::Bind(&InputDeviceFactoryEvdev::GetTouchDeviceStatus,
81 input_device_factory_,
82 base::Bind(&ForwardGetTouchDeviceStatusReply,
83 base::ThreadTaskRunnerHandle::Get(), reply)));
84 }
85
86 void InputDeviceFactoryEvdevProxy::GetTouchEventLog(
87 const base::FilePath& out_dir,
88 const GetTouchEventLogReply& reply) {
89 task_runner_->PostTask(
90 FROM_HERE,
91 base::Bind(&InputDeviceFactoryEvdev::GetTouchEventLog,
92 input_device_factory_, out_dir,
93 base::Bind(&ForwardGetTouchEventLogReply,
94 base::ThreadTaskRunnerHandle::Get(), reply)));
95 }
96
97 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_device_factory_evdev_proxy.h ('k') | ui/events/ozone/evdev/input_device_settings_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698