| 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 <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual ~EventExecutorMac() {} | 35 virtual ~EventExecutorMac() {} |
| 36 | 36 |
| 37 // ClipboardStub interface. | 37 // ClipboardStub interface. |
| 38 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 38 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; |
| 39 | 39 |
| 40 // InputStub interface. | 40 // InputStub interface. |
| 41 virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE; | 41 virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE; |
| 42 virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE; | 42 virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE; |
| 43 | 43 |
| 44 // EventExecutor interface. | 44 // EventExecutor interface. |
| 45 virtual void OnSessionStarted() OVERRIDE; | 45 virtual void OnSessionStarted( |
| 46 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; |
| 46 virtual void OnSessionFinished() OVERRIDE; | 47 virtual void OnSessionFinished() OVERRIDE; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 MessageLoop* message_loop_; | 50 MessageLoop* message_loop_; |
| 50 SkIPoint mouse_pos_; | 51 SkIPoint mouse_pos_; |
| 51 uint32 mouse_button_state_; | 52 uint32 mouse_button_state_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(EventExecutorMac); | 54 DISALLOW_COPY_AND_ASSIGN(EventExecutorMac); |
| 54 }; | 55 }; |
| 55 | 56 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 int dx = event.wheel_offset_x(); | 320 int dx = event.wheel_offset_x(); |
| 320 int dy = event.wheel_offset_y(); | 321 int dy = event.wheel_offset_y(); |
| 321 // Note that |dy| (the vertical wheel) is the primary wheel. | 322 // Note that |dy| (the vertical wheel) is the primary wheel. |
| 322 error = CGPostScrollWheelEvent(2, dy, dx); | 323 error = CGPostScrollWheelEvent(2, dy, dx); |
| 323 if (error != kCGErrorSuccess) { | 324 if (error != kCGErrorSuccess) { |
| 324 LOG(WARNING) << "CGPostScrollWheelEvent error " << error; | 325 LOG(WARNING) << "CGPostScrollWheelEvent error " << error; |
| 325 } | 326 } |
| 326 } | 327 } |
| 327 } | 328 } |
| 328 | 329 |
| 329 void EventExecutorMac::OnSessionStarted() { | 330 void EventExecutorMac::OnSessionStarted( |
| 331 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 330 return; | 332 return; |
| 331 } | 333 } |
| 332 | 334 |
| 333 void EventExecutorMac::OnSessionFinished() { | 335 void EventExecutorMac::OnSessionFinished() { |
| 334 return; | 336 return; |
| 335 } | 337 } |
| 336 | 338 |
| 337 } // namespace | 339 } // namespace |
| 338 | 340 |
| 339 scoped_ptr<EventExecutor> EventExecutor::Create(MessageLoop* message_loop, | 341 scoped_ptr<EventExecutor> EventExecutor::Create(MessageLoop* message_loop, |
| 340 base::MessageLoopProxy* ui_loop, | 342 base::MessageLoopProxy* ui_loop, |
| 341 Capturer* capturer) { | 343 Capturer* capturer) { |
| 342 return scoped_ptr<EventExecutor>( | 344 return scoped_ptr<EventExecutor>( |
| 343 new EventExecutorMac(message_loop)); | 345 new EventExecutorMac(message_loop)); |
| 344 } | 346 } |
| 345 | 347 |
| 346 } // namespace remoting | 348 } // namespace remoting |
| OLD | NEW |