summaryrefslogtreecommitdiffstats
path: root/remoting/host/local_input_monitor.h
blob: 57ec051828bc8dc1383ab9582e625dceeae7c0bb (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
// Copyright (c) 2012 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_LOCAL_INPUT_MONITOR_H_
#define REMOTING_HOST_LOCAL_INPUT_MONITOR_H_

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"

namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace remoting {

class ClientSessionControl;

// Monitors the local input to notify about mouse movements. On Mac and Linux
// catches the disconnection keyboard shortcut (Ctlr-Alt-Esc) and invokes
// SessionController::Delegate::DisconnectSession() when this key combination is
// pressed.
//
// TODO(sergeyu): Refactor shortcut code to a separate class.
class LocalInputMonitor {
 public:
  virtual ~LocalInputMonitor() {}

  // Creates a platform-specific instance of LocalInputMonitor.
  // |client_session_control| is called on the |caller_task_runner| thread.
  static scoped_ptr<LocalInputMonitor> Create(
      scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
      scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
      scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
      base::WeakPtr<ClientSessionControl> client_session_control);

 protected:
  LocalInputMonitor() {}
};

}  // namespace remoting

#endif  // REMOTING_HOST_LOCAL_INPUT_MONITOR_H_