Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: remoting/host/ipc_desktop_environment.cc

Issue 11028128: [Chromoting] Request the daemon to open a terminal once a connection has been accepted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feeback and rebased on top of https://chromiumcodereview.appspot.com/11017065/ Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/ipc_desktop_environment.cc
diff --git a/remoting/host/ipc_desktop_environment.cc b/remoting/host/ipc_desktop_environment.cc
new file mode 100644
index 0000000000000000000000000000000000000000..80253f166831449ed4934c5429f56df483a70f26
--- /dev/null
+++ b/remoting/host/ipc_desktop_environment.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/ipc_desktop_environment.h"
+
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+#include "remoting/host/audio_capturer.h"
+#include "remoting/host/chromoting_host.h"
+#include "remoting/host/desktop_session_connector.h"
+#include "remoting/host/event_executor.h"
+#include "remoting/host/video_frame_capturer.h"
+
+namespace remoting {
+
+IpcDesktopEnvironment::IpcDesktopEnvironment(
+ scoped_ptr<AudioCapturer> audio_capturer,
+ scoped_ptr<EventExecutor> event_executor,
+ scoped_ptr<VideoFrameCapturer> video_capturer,
+ DesktopSessionConnector* desktop_session_connector,
+ scoped_refptr<ChromotingHost> host)
+ : DesktopEnvironment(audio_capturer.Pass(),
+ event_executor.Pass(),
+ video_capturer.Pass()),
+ connected_(false),
+ desktop_session_connector_(desktop_session_connector),
+ host_(host) {
+}
+
+void IpcDesktopEnvironment::Start(
+ scoped_ptr<protocol::ClipboardStub> client_clipboard) {
+ DCHECK(!connected_);
+
+ connected_ = true;
+ desktop_session_connector_->ConnectTerminal(this);
+
+ DesktopEnvironment::Start(client_clipboard.Pass());
+}
+
+void IpcDesktopEnvironment::DisconnectClient() {
+ host_->DisconnectClient(this);
+}
+
+IpcDesktopEnvironment::~IpcDesktopEnvironment() {
+ if (connected_) {
+ connected_ = false;
+ desktop_session_connector_->DisconnectTerminal(this);
+ }
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698