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/input_injector.h" | 5 #include "remoting/host/input_injector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #include <Carbon/Carbon.h> | 9 #include <Carbon/Carbon.h> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/base/keycodes/keycode_converter.h" | 25 #include "ui/base/keycodes/keycode_converter.h" |
26 | 26 |
27 namespace remoting { | 27 namespace remoting { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 using protocol::ClipboardEvent; | 31 using protocol::ClipboardEvent; |
32 using protocol::KeyEvent; | 32 using protocol::KeyEvent; |
33 using protocol::MouseEvent; | 33 using protocol::MouseEvent; |
34 | 34 |
35 // skia/ext/skia_utils_mac.h only defines CGRectToSkRect(). | |
36 SkIRect CGRectToSkIRect(const CGRect& rect) { | |
37 SkIRect result; | |
38 gfx::CGRectToSkRect(rect).round(&result); | |
39 return result; | |
40 } | |
41 | |
42 // A class to generate events on Mac. | 35 // A class to generate events on Mac. |
43 class InputInjectorMac : public InputInjector { | 36 class InputInjectorMac : public InputInjector { |
44 public: | 37 public: |
45 explicit InputInjectorMac( | 38 explicit InputInjectorMac( |
46 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 39 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
47 virtual ~InputInjectorMac(); | 40 virtual ~InputInjectorMac(); |
48 | 41 |
49 // ClipboardStub interface. | 42 // ClipboardStub interface. |
50 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 43 virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; |
51 | 44 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 278 |
286 } // namespace | 279 } // namespace |
287 | 280 |
288 scoped_ptr<InputInjector> InputInjector::Create( | 281 scoped_ptr<InputInjector> InputInjector::Create( |
289 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 282 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
290 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 283 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
291 return scoped_ptr<InputInjector>(new InputInjectorMac(main_task_runner)); | 284 return scoped_ptr<InputInjector>(new InputInjectorMac(main_task_runner)); |
292 } | 285 } |
293 | 286 |
294 } // namespace remoting | 287 } // namespace remoting |
OLD | NEW |