1 // Copyright (c) 2013 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_WIN_RDP_CLIENT_H_ 6 #define REMOTING_HOST_WIN_RDP_CLIENT_H_ 7 8 #include <string> 9 10 #include "base/basictypes.h" 11 #include "base/memory/ref_counted.h" 12 #include "base/memory/scoped_ptr.h" 13 #include "base/threading/non_thread_safe.h" 14 #include "third_party/skia/include/core/SkSize.h" 15 16 namespace base { 17 class SingleThreadTaskRunner; 18 } // namespace 19 20 namespace remoting { 21 22 // Establishes a loopback RDP connection to spawn a new Windows session. 23 class RdpClient : public base::NonThreadSafe { 24 public: 25 class EventHandler { 26 public: 27 virtual ~EventHandler() {} 28 29 // Notifies the event handler that an RDP connection has been established 30 // successfully. 31 virtual void OnRdpConnected() = 0; 32 33 // Notifies that the RDP connection has been closed. 34 virtual void OnRdpClosed() = 0; 35 }; 36 37 RdpClient( 38 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 39 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 40 const SkISize& screen_size, 41 const std::string& terminal_id, 42 EventHandler* event_handler); 43 virtual ~RdpClient(); 44 45 // Sends Secure Attention Sequence to the session. 46 void InjectSas(); 47 48 private: 49 // The actual implementation resides in Core class. 50 class Core; 51 scoped_refptr<Core> core_; 52 53 DISALLOW_COPY_AND_ASSIGN(RdpClient); 54 }; 55 56 } // namespace remoting 57 58 #endif // REMOTING_HOST_WIN_RDP_CLIENT_H_ 59