| OLD | NEW |
| (Empty) | |
| 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 #include "remoting/host/ipc_desktop_environment.h" |
| 6 |
| 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 10 #include "remoting/host/audio_capturer.h" |
| 11 #include "remoting/host/client_session.h" |
| 12 #include "remoting/host/desktop_session_connector.h" |
| 13 #include "remoting/host/event_executor.h" |
| 14 #include "remoting/host/video_frame_capturer.h" |
| 15 |
| 16 namespace remoting { |
| 17 |
| 18 IpcDesktopEnvironment::IpcDesktopEnvironment( |
| 19 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 20 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 21 DesktopSessionConnector* desktop_session_connector, |
| 22 ClientSession* client) |
| 23 : DesktopEnvironment( |
| 24 AudioCapturer::Create(), |
| 25 EventExecutor::Create(input_task_runner, ui_task_runner), |
| 26 scoped_ptr<VideoFrameCapturer>(VideoFrameCapturer::Create())), |
| 27 desktop_session_connector_(desktop_session_connector), |
| 28 client_(client), |
| 29 connected_(false) { |
| 30 } |
| 31 |
| 32 void IpcDesktopEnvironment::Start( |
| 33 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 34 DCHECK(!connected_); |
| 35 |
| 36 connected_ = true; |
| 37 desktop_session_connector_->ConnectTerminal(this); |
| 38 |
| 39 DesktopEnvironment::Start(client_clipboard.Pass()); |
| 40 } |
| 41 |
| 42 void IpcDesktopEnvironment::DisconnectClient() { |
| 43 client_->Disconnect(); |
| 44 } |
| 45 |
| 46 IpcDesktopEnvironment::~IpcDesktopEnvironment() { |
| 47 if (connected_) { |
| 48 connected_ = false; |
| 49 desktop_session_connector_->DisconnectTerminal(this); |
| 50 } |
| 51 } |
| 52 |
| 53 } // namespace remoting |
| OLD | NEW |