OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/base/user_input_monitor.h" | 5 #include "media/base/user_input_monitor.h" |
6 | 6 |
7 #include <sys/select.h> | 7 #include <sys/select.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #define XK_MISCELLANY | 9 #define XK_MISCELLANY |
10 #include <X11/keysymdef.h> | 10 #include <X11/keysymdef.h> |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 void UserInputMonitorLinuxCore::OnFileCanWriteWithoutBlocking(int fd) { | 287 void UserInputMonitorLinuxCore::OnFileCanWriteWithoutBlocking(int fd) { |
288 NOTREACHED(); | 288 NOTREACHED(); |
289 } | 289 } |
290 | 290 |
291 void UserInputMonitorLinuxCore::ProcessXEvent(xEvent* event) { | 291 void UserInputMonitorLinuxCore::ProcessXEvent(xEvent* event) { |
292 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 292 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
293 if (event->u.u.type == MotionNotify) { | 293 if (event->u.u.type == MotionNotify) { |
294 SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX, | 294 SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX, |
295 event->u.keyButtonPointer.rootY)); | 295 event->u.keyButtonPointer.rootY)); |
296 mouse_listeners_->Notify( | 296 mouse_listeners_->Notify( |
297 &UserInputMonitor::MouseEventListener::OnMouseMoved, position); | 297 FROM_HERE, &UserInputMonitor::MouseEventListener::OnMouseMoved, |
| 298 position); |
298 } else { | 299 } else { |
299 ui::EventType type; | 300 ui::EventType type; |
300 if (event->u.u.type == KeyPress) { | 301 if (event->u.u.type == KeyPress) { |
301 type = ui::ET_KEY_PRESSED; | 302 type = ui::ET_KEY_PRESSED; |
302 } else if (event->u.u.type == KeyRelease) { | 303 } else if (event->u.u.type == KeyRelease) { |
303 type = ui::ET_KEY_RELEASED; | 304 type = ui::ET_KEY_RELEASED; |
304 } else { | 305 } else { |
305 NOTREACHED(); | 306 NOTREACHED(); |
306 return; | 307 return; |
307 } | 308 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } // namespace | 375 } // namespace |
375 | 376 |
376 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( | 377 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( |
377 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 378 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
378 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { | 379 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { |
379 return scoped_ptr<UserInputMonitor>( | 380 return scoped_ptr<UserInputMonitor>( |
380 new UserInputMonitorLinux(io_task_runner)); | 381 new UserInputMonitorLinux(io_task_runner)); |
381 } | 382 } |
382 | 383 |
383 } // namespace media | 384 } // namespace media |
OLD | NEW |