summaryrefslogtreecommitdiffstats
path: root/remoting/host/input_injector_chromeos.h
blob: 02320f829eb00a495592bac054c705acc32bb747 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_
#define REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_

#include "base/single_thread_task_runner.h"
#include "remoting/host/input_injector.h"

namespace remoting {

// InputInjector implementation that translates input to ui::Events and passes
// them to a supplied delegate for injection into ChromeOS.
class InputInjectorChromeos : public InputInjector {
 public:
  explicit InputInjectorChromeos(
      scoped_refptr<base::SingleThreadTaskRunner> task_runner);

  ~InputInjectorChromeos() override;

  // Clipboard stub interface.
  void InjectClipboardEvent(const protocol::ClipboardEvent& event) override;

  // InputStub interface.
  void InjectKeyEvent(const protocol::KeyEvent& event) override;
  void InjectTextEvent(const protocol::TextEvent& event) override;
  void InjectMouseEvent(const protocol::MouseEvent& event) override;
  void InjectTouchEvent(const protocol::TouchEvent& event) override;

  // InputInjector interface.
  void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) override;

 private:
  class Core;

  // Task runner for input injection.
  scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_;
  scoped_ptr<Core> core_;

  DISALLOW_COPY_AND_ASSIGN(InputInjectorChromeos);
};

}  // namespace remoting

#endif  // REMOTING_HOST_INPUT_INJECTOR_CHROMEOS_H_