Home | History | Annotate | Download | only in host
      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.
      4 
      5 #ifndef REMOTING_HOST_LOCAL_INPUT_MONITOR_H_
      6 #define REMOTING_HOST_LOCAL_INPUT_MONITOR_H_
      7 
      8 #include "base/memory/ref_counted.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "base/memory/weak_ptr.h"
     11 
     12 namespace base {
     13 class SingleThreadTaskRunner;
     14 }  // namespace base
     15 
     16 namespace remoting {
     17 
     18 class ClientSessionControl;
     19 
     20 // Monitors the local input to notify about mouse movements. On Mac and Linux
     21 // catches the disconnection keyboard shortcut (Ctlr-Alt-Esc) and invokes
     22 // SessionController::Delegate::DisconnectSession() when this key combination is
     23 // pressed.
     24 //
     25 // TODO(sergeyu): Refactor shortcut code to a separate class.
     26 class LocalInputMonitor {
     27  public:
     28   virtual ~LocalInputMonitor() {}
     29 
     30   // Creates a platform-specific instance of LocalInputMonitor.
     31   // |client_session_control| is called on the |caller_task_runner| thread.
     32   static scoped_ptr<LocalInputMonitor> Create(
     33       scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
     34       scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
     35       scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
     36       base::WeakPtr<ClientSessionControl> client_session_control);
     37 
     38  protected:
     39   LocalInputMonitor() {}
     40 };
     41 
     42 }  // namespace remoting
     43 
     44 #endif  // REMOTING_HOST_LOCAL_INPUT_MONITOR_H_
     45