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

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

Issue 893753002: Dump touchpad event logs for touch log source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased codes. However, seems to have some problems. Created 5 years, 10 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/ozone/evdev/input_device_factory_evdev_proxy.h" 5 #include "ui/events/ozone/evdev/input_device_factory_evdev_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" 9 #include "ui/events/ozone/evdev/input_device_factory_evdev.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 namespace { 13 namespace {
14 14
15 void ForwardGetTouchDeviceStatusReply( 15 void ForwardGetTouchDeviceStatusReply(
16 scoped_refptr<base::SingleThreadTaskRunner> reply_runner, 16 scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
17 const GetTouchDeviceStatusReply& reply, 17 const GetTouchDeviceStatusReply& reply,
18 scoped_ptr<std::string> status) { 18 scoped_ptr<std::string> status) {
19 // Thread hop back to UI for reply. 19 // Thread hop back to UI for reply.
20 reply_runner->PostTask(FROM_HERE, base::Bind(reply, base::Passed(&status))); 20 reply_runner->PostTask(FROM_HERE, base::Bind(reply, base::Passed(&status)));
21 } 21 }
22 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
23 } // namespace 32 } // namespace
24 33
25 InputDeviceFactoryEvdevProxy::InputDeviceFactoryEvdevProxy( 34 InputDeviceFactoryEvdevProxy::InputDeviceFactoryEvdevProxy(
26 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 35 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
27 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory) 36 base::WeakPtr<InputDeviceFactoryEvdev> input_device_factory)
28 : task_runner_(task_runner), input_device_factory_(input_device_factory) { 37 : task_runner_(task_runner), input_device_factory_(input_device_factory) {
29 } 38 }
30 39
31 InputDeviceFactoryEvdevProxy::~InputDeviceFactoryEvdevProxy() { 40 InputDeviceFactoryEvdevProxy::~InputDeviceFactoryEvdevProxy() {
32 } 41 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void InputDeviceFactoryEvdevProxy::GetTouchDeviceStatus( 125 void InputDeviceFactoryEvdevProxy::GetTouchDeviceStatus(
117 const GetTouchDeviceStatusReply& reply) { 126 const GetTouchDeviceStatusReply& reply) {
118 task_runner_->PostTask( 127 task_runner_->PostTask(
119 FROM_HERE, 128 FROM_HERE,
120 base::Bind(&InputDeviceFactoryEvdev::GetTouchDeviceStatus, 129 base::Bind(&InputDeviceFactoryEvdev::GetTouchDeviceStatus,
121 input_device_factory_, 130 input_device_factory_,
122 base::Bind(&ForwardGetTouchDeviceStatusReply, 131 base::Bind(&ForwardGetTouchDeviceStatusReply,
123 base::ThreadTaskRunnerHandle::Get(), reply))); 132 base::ThreadTaskRunnerHandle::Get(), reply)));
124 } 133 }
125 134
135 void InputDeviceFactoryEvdevProxy::GetTouchEventLog(
136 const base::FilePath& out_dir,
137 const GetTouchEventLogReply& reply) {
138 task_runner_->PostTask(
139 FROM_HERE,
140 base::Bind(&InputDeviceFactoryEvdev::GetTouchEventLog,
141 input_device_factory_, out_dir,
142 base::Bind(&ForwardGetTouchEventLogReply,
143 base::ThreadTaskRunnerHandle::Get(), reply)));
144 }
145
126 } // namespace ui 146 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698