Roll src/third_party/WebKit b41a10f:afd8afd (svn 202201:202202)
[chromium-blink-merge.git] / remoting / host / input_injector.h
blob99a7ddee4693e46d4afd48971f5580f6ef2ab379
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_INPUT_INJECTOR_H_
6 #define REMOTING_HOST_INPUT_INJECTOR_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/protocol/clipboard_stub.h"
11 #include "remoting/protocol/input_stub.h"
13 namespace base {
14 class SingleThreadTaskRunner;
15 } // namespace base
17 namespace remoting {
19 // TODO(sergeyu): Move ClipboardStub implementation to Clipboard.
20 class InputInjector : public protocol::ClipboardStub,
21 public protocol::InputStub {
22 public:
23 // Creates a default input injector for the current platform. This
24 // object should do as much work as possible on |main_task_runner|,
25 // using |ui_task_runner| only for tasks actually requiring a UI
26 // thread.
27 static scoped_ptr<InputInjector> Create(
28 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
31 // Returns true if the InputInjector returned by Create() supports
32 // InjectTouchEvent() on this platform.
33 static bool SupportsTouchEvents();
35 // Initialises any objects needed to execute events.
36 virtual void Start(
37 scoped_ptr<protocol::ClipboardStub> client_clipboard) = 0;
40 } // namespace remoting
42 #endif // REMOTING_HOST_INPUT_INJECTOR_H_