OLD | NEW |
---|---|
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/event_thread_evdev.h" | 5 #include "ui/events/ozone/evdev/event_thread_evdev.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 void Init() override { | 37 void Init() override { |
38 TRACE_EVENT0("evdev", "EvdevThread::Init"); | 38 TRACE_EVENT0("evdev", "EvdevThread::Init"); |
39 input_device_factory_ = | 39 input_device_factory_ = |
40 new InputDeviceFactoryEvdev(std::move(dispatcher_), cursor_); | 40 new InputDeviceFactoryEvdev(std::move(dispatcher_), cursor_); |
41 | 41 |
42 std::unique_ptr<InputDeviceFactoryEvdevProxy> proxy( | 42 std::unique_ptr<InputDeviceFactoryEvdevProxy> proxy( |
43 new InputDeviceFactoryEvdevProxy(base::ThreadTaskRunnerHandle::Get(), | 43 new InputDeviceFactoryEvdevProxy(base::ThreadTaskRunnerHandle::Get(), |
44 input_device_factory_->GetWeakPtr())); | 44 input_device_factory_->GetWeakPtr())); |
45 | 45 |
46 cursor_->InitializeOnEvdev(); | 46 if (cursor_) |
derekjchow1
2017/01/13 18:12:28
Can Cast provide its own CursorDelegateEvdev? If s
Joshua LeVasseur
2017/01/13 23:38:13
Glancing through the evdev code, it seems to be de
spang
2017/01/16 18:54:54
Yes, it did support null, it just breaks from time
| |
47 cursor_->InitializeOnEvdev(); | |
47 | 48 |
48 init_runner_->PostTask(FROM_HERE, | 49 init_runner_->PostTask(FROM_HERE, |
49 base::Bind(init_callback_, base::Passed(&proxy))); | 50 base::Bind(init_callback_, base::Passed(&proxy))); |
50 } | 51 } |
51 | 52 |
52 void CleanUp() override { | 53 void CleanUp() override { |
53 TRACE_EVENT0("evdev", "EvdevThread::CleanUp"); | 54 TRACE_EVENT0("evdev", "EvdevThread::CleanUp"); |
54 delete input_device_factory_; | 55 delete input_device_factory_; |
55 } | 56 } |
56 | 57 |
(...skipping 23 matching lines...) Expand all Loading... | |
80 TRACE_EVENT0("evdev", "EventThreadEvdev::Start"); | 81 TRACE_EVENT0("evdev", "EventThreadEvdev::Start"); |
81 thread_.reset(new EvdevThread(std::move(dispatcher), cursor, callback)); | 82 thread_.reset(new EvdevThread(std::move(dispatcher), cursor, callback)); |
82 base::Thread::Options thread_options; | 83 base::Thread::Options thread_options; |
83 thread_options.message_loop_type = base::MessageLoop::TYPE_UI; | 84 thread_options.message_loop_type = base::MessageLoop::TYPE_UI; |
84 thread_options.priority = base::ThreadPriority::DISPLAY; | 85 thread_options.priority = base::ThreadPriority::DISPLAY; |
85 if (!thread_->StartWithOptions(thread_options)) | 86 if (!thread_->StartWithOptions(thread_options)) |
86 LOG(FATAL) << "Failed to create input thread"; | 87 LOG(FATAL) << "Failed to create input thread"; |
87 } | 88 } |
88 | 89 |
89 } // namespace ui | 90 } // namespace ui |
OLD | NEW |