Roll src/third_party/WebKit b41a10f:afd8afd (svn 202201:202202)
[chromium-blink-merge.git] / remoting / host / mouse_shape_pump.h
blobcc00189390037ac4c7f3fec134ffd66549bb2bd6
1 // Copyright 2015 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_MOUSE_SHAPE_PUMP_H_
6 #define REMOTING_HOST_MOUSE_SHAPE_PUMP_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "base/threading/thread_checker.h"
13 namespace base {
14 class SingleThreadTaskRunner;
15 } // namespace base
17 namespace webrtc {
18 class MouseCursorMonitor;
19 } // namespace webrtc
21 namespace remoting {
23 namespace protocol {
24 class CursorShapeStub;
25 class CursorShapeInfo;
26 } // namespace protocol
28 // MouseShapePump is responsible for capturing mouse shape using
29 // MouseCursorMonitor and sending it to a CursorShapeStub.
30 class MouseShapePump {
31 public:
32 MouseShapePump(
33 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
34 scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor,
35 protocol::CursorShapeStub* cursor_shape_stub);
36 ~MouseShapePump();
38 private:
39 class Core;
41 void OnCursorShape(scoped_ptr<protocol::CursorShapeInfo> cursor);
43 base::ThreadChecker thread_checker_;
45 scoped_ptr<Core> core_;
46 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
47 protocol::CursorShapeStub* cursor_shape_stub_;
49 base::WeakPtrFactory<MouseShapePump> weak_factory_;
51 DISALLOW_COPY_AND_ASSIGN(MouseShapePump);
54 } // namespace remoting
56 #endif // REMOTING_HOST_MOUSE_SHAPE_PUMP_H_