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

Unified Diff: remoting/host/desktop_process_main.cc

Issue 12087073: Pass a DesktopEnvironmentFactory when creating DesktopProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased. fixed posix. Created 7 years, 11 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
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_process_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_process_main.cc
diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc
index fa678de69ef4386064b3cbc2550d5099d906c4b7..71958620094e4d35222a07badef81f52c1135779 100644
--- a/remoting/host/desktop_process_main.cc
+++ b/remoting/host/desktop_process_main.cc
@@ -10,6 +10,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/run_loop.h"
#include "base/scoped_native_library.h"
@@ -18,10 +19,12 @@
#include "base/win/windows_version.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/base/breakpad.h"
+#include "remoting/host/basic_desktop_environment.h"
#include "remoting/host/desktop_process.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/logging.h"
#include "remoting/host/usage_stats_consent.h"
+#include "remoting/host/win/session_desktop_environment.h"
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
@@ -94,7 +97,20 @@ int main(int argc, char** argv) {
quit_ui_task_runner);
remoting::DesktopProcess desktop_process(ui_task_runner, channel_name);
- if (!desktop_process.Start())
+
+ // Create a platform-dependent environment factory.
+ scoped_ptr<remoting::DesktopEnvironmentFactory> desktop_environment_factory;
+#if defined(OS_WIN)
+ desktop_environment_factory.reset(
+ new remoting::SessionDesktopEnvironmentFactory(
+ base::Bind(&remoting::DesktopProcess::InjectSas,
+ desktop_process.AsWeakPtr())));
+#else // !defined(OS_WIN)
+ desktop_environment_factory.reset(
+ new remoting::BasicDesktopEnvironmentFactory(true));
+#endif // !defined(OS_WIN)
+
+ if (!desktop_process.Start(desktop_environment_factory.Pass()))
return remoting::kInitializationFailed;
// Run the UI message loop.
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698