OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/win/rdp_desktop_session.h" | 5 #include "remoting/host/win/rdp_desktop_session.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "remoting/base/auto_thread_task_runner.h" | 8 #include "remoting/base/auto_thread_task_runner.h" |
9 #include "remoting/host/win/chromoting_module.h" | 9 #include "remoting/host/win/chromoting_module.h" |
| 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
10 | 11 |
11 namespace remoting { | 12 namespace remoting { |
12 | 13 |
13 RdpDesktopSession::RdpDesktopSession() { | 14 RdpDesktopSession::RdpDesktopSession() { |
14 } | 15 } |
15 | 16 |
16 STDMETHODIMP RdpDesktopSession::Connect( | 17 STDMETHODIMP RdpDesktopSession::Connect( |
17 long width, | 18 long width, |
18 long height, | 19 long height, |
19 BSTR terminal_id, | 20 BSTR terminal_id, |
20 IRdpDesktopSessionEventHandler* event_handler) { | 21 IRdpDesktopSessionEventHandler* event_handler) { |
21 event_handler_ = event_handler; | 22 event_handler_ = event_handler; |
22 | 23 |
23 scoped_refptr<AutoThreadTaskRunner> task_runner = | 24 scoped_refptr<AutoThreadTaskRunner> task_runner = |
24 ChromotingModule::task_runner(); | 25 ChromotingModule::task_runner(); |
25 DCHECK(task_runner->BelongsToCurrentThread()); | 26 DCHECK(task_runner->BelongsToCurrentThread()); |
26 | 27 |
27 client_.reset(new RdpClient(task_runner, task_runner, | 28 client_.reset(new RdpClient(task_runner, task_runner, |
28 SkISize::Make(width, height), | 29 webrtc::DesktopSize(width, height), |
29 UTF16ToUTF8(terminal_id), this)); | 30 UTF16ToUTF8(terminal_id), this)); |
30 return S_OK; | 31 return S_OK; |
31 } | 32 } |
32 | 33 |
33 STDMETHODIMP RdpDesktopSession::Disconnect() { | 34 STDMETHODIMP RdpDesktopSession::Disconnect() { |
34 client_.reset(); | 35 client_.reset(); |
35 event_handler_ = NULL; | 36 event_handler_ = NULL; |
36 return S_OK; | 37 return S_OK; |
37 } | 38 } |
38 | 39 |
(...skipping 13 matching lines...) Expand all Loading... |
52 << std::hex << result << std::dec << "."; | 53 << std::hex << result << std::dec << "."; |
53 } | 54 } |
54 | 55 |
55 void RdpDesktopSession::OnRdpClosed() { | 56 void RdpDesktopSession::OnRdpClosed() { |
56 HRESULT result = event_handler_->OnRdpClosed(); | 57 HRESULT result = event_handler_->OnRdpClosed(); |
57 CHECK(SUCCEEDED(result)) << "OnRdpClosed() failed: 0x" << std::hex << result | 58 CHECK(SUCCEEDED(result)) << "OnRdpClosed() failed: 0x" << std::hex << result |
58 << std::dec << "."; | 59 << std::dec << "."; |
59 } | 60 } |
60 | 61 |
61 } // namespace remoting | 62 } // namespace remoting |
OLD | NEW |