OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/event_executor.h" | 5 #include "remoting/host/event_executor.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/XF86keysym.h> | 10 #include <X11/XF86keysym.h> |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 419 } |
420 if (event.has_wheel_offset_x() && event.wheel_offset_x() != 0) { | 420 if (event.has_wheel_offset_x() && event.wheel_offset_x() != 0) { |
421 int dx = event.wheel_offset_x(); | 421 int dx = event.wheel_offset_x(); |
422 InjectScrollWheelClicks(HorizontalScrollWheelToX11ButtonNumber(dx), | 422 InjectScrollWheelClicks(HorizontalScrollWheelToX11ButtonNumber(dx), |
423 abs(dx)); | 423 abs(dx)); |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 } // namespace | 427 } // namespace |
428 | 428 |
429 EventExecutor* EventExecutor::Create(MessageLoop* message_loop, | 429 scoped_ptr<protocol::InputStub> EventExecutor::Create(MessageLoop* message_loop, |
430 Capturer* capturer) { | 430 Capturer* capturer) { |
431 EventExecutorLinux* executor = new EventExecutorLinux(message_loop, capturer); | 431 scoped_ptr<EventExecutorLinux> executor( |
| 432 new EventExecutorLinux(message_loop, capturer)); |
432 if (!executor->Init()) { | 433 if (!executor->Init()) { |
433 delete executor; | 434 executor.reset(NULL); |
434 executor = NULL; | |
435 } | 435 } |
436 return executor; | 436 return executor.PassAs<protocol::InputStub>(); |
437 } | 437 } |
438 | 438 |
439 } // namespace remoting | 439 } // namespace remoting |
OLD | NEW |