| 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 <windows.h> | 7 #include <windows.h> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 53 using protocol::MouseEvent; | 53 using protocol::MouseEvent; | 
| 54 | 54 | 
| 55 // A class to generate events on Windows. | 55 // A class to generate events on Windows. | 
| 56 class InputInjectorWin : public InputInjector { | 56 class InputInjectorWin : public InputInjector { | 
| 57  public: | 57  public: | 
| 58   InputInjectorWin(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 58   InputInjectorWin(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 
| 59                    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 59                    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 
| 60   virtual ~InputInjectorWin(); | 60   virtual ~InputInjectorWin(); | 
| 61 | 61 | 
| 62   // ClipboardStub interface. | 62   // ClipboardStub interface. | 
| 63   virtual void InjectClipboardEvent(const ClipboardEvent& event) OVERRIDE; | 63   virtual void InjectClipboardEvent(const ClipboardEvent& event) override; | 
| 64 | 64 | 
| 65   // InputStub interface. | 65   // InputStub interface. | 
| 66   virtual void InjectKeyEvent(const KeyEvent& event) OVERRIDE; | 66   virtual void InjectKeyEvent(const KeyEvent& event) override; | 
| 67   virtual void InjectTextEvent(const TextEvent& event) OVERRIDE; | 67   virtual void InjectTextEvent(const TextEvent& event) override; | 
| 68   virtual void InjectMouseEvent(const MouseEvent& event) OVERRIDE; | 68   virtual void InjectMouseEvent(const MouseEvent& event) override; | 
| 69 | 69 | 
| 70   // InputInjector interface. | 70   // InputInjector interface. | 
| 71   virtual void Start( | 71   virtual void Start( | 
| 72       scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; | 72       scoped_ptr<protocol::ClipboardStub> client_clipboard) override; | 
| 73 | 73 | 
| 74  private: | 74  private: | 
| 75   // The actual implementation resides in InputInjectorWin::Core class. | 75   // The actual implementation resides in InputInjectorWin::Core class. | 
| 76   class Core : public base::RefCountedThreadSafe<Core> { | 76   class Core : public base::RefCountedThreadSafe<Core> { | 
| 77    public: | 77    public: | 
| 78     Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 78     Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 
| 79          scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 79          scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 
| 80 | 80 | 
| 81     // Mirrors the ClipboardStub interface. | 81     // Mirrors the ClipboardStub interface. | 
| 82     void InjectClipboardEvent(const ClipboardEvent& event); | 82     void InjectClipboardEvent(const ClipboardEvent& event); | 
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 323 }  // namespace | 323 }  // namespace | 
| 324 | 324 | 
| 325 scoped_ptr<InputInjector> InputInjector::Create( | 325 scoped_ptr<InputInjector> InputInjector::Create( | 
| 326     scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 326     scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 
| 327     scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 327     scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 
| 328   return make_scoped_ptr( | 328   return make_scoped_ptr( | 
| 329       new InputInjectorWin(main_task_runner, ui_task_runner)); | 329       new InputInjectorWin(main_task_runner, ui_task_runner)); | 
| 330 } | 330 } | 
| 331 | 331 | 
| 332 }  // namespace remoting | 332 }  // namespace remoting | 
| OLD | NEW | 
|---|