| 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 "remoting/host/audio_capturer.h" |
| 10 #include "remoting/host/daemon_sender.h" |
| 11 #include "remoting/host/event_executor.h" |
| 12 #include "remoting/host/video_frame_capturer.h" |
| 13 |
| 14 namespace remoting { |
| 15 |
| 16 IpcDesktopEnvironment::IpcDesktopEnvironment( |
| 17 scoped_ptr<AudioCapturer> audio_capturer, |
| 18 scoped_ptr<EventExecutor> event_executor, |
| 19 scoped_ptr<VideoFrameCapturer> video_capturer, |
| 20 DaemonSender* daemon_sender) |
| 21 : DesktopEnvironment(audio_capturer.Pass(), |
| 22 event_executor.Pass(), |
| 23 video_capturer.Pass()), |
| 24 daemon_sender_(daemon_sender), |
| 25 terminal_opened_(false) { |
| 26 } |
| 27 |
| 28 void IpcDesktopEnvironment::Start( |
| 29 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 30 DCHECK(!terminal_opened_); |
| 31 |
| 32 terminal_opened_ = true; |
| 33 daemon_sender_->OpenTerminal(this); |
| 34 |
| 35 DesktopEnvironment::Start(client_clipboard.Pass()); |
| 36 } |
| 37 |
| 38 IpcDesktopEnvironment::~IpcDesktopEnvironment() { |
| 39 if (terminal_opened_) |
| 40 daemon_sender_->CloseTerminal(this); |
| 41 } |
| 42 |
| 43 } // namespace remoting |
| OLD | NEW |