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

Unified Diff: remoting/host/desktop_session_win.cc

Issue 15077010: [Chromoting] Refactored worker process launching code and speeded up the desktop process launch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 7 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/daemon_process_win.cc ('k') | remoting/host/host_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_win.cc
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
index 36d7fb1470067fb386c0666a89d2cd6174871180..5d126d2cd75d68a2eac6dce7656db17d3200b7de 100644
--- a/remoting/host/desktop_session_win.cc
+++ b/remoting/host/desktop_session_win.cc
@@ -20,6 +20,7 @@
#include "base/utf_string_conversions.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
+#include "base/win/windows_version.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "net/base/ip_endpoint.h"
@@ -512,9 +513,20 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
ReportElapsedTime("attached");
- // Get the name of the executable the desktop process will run.
+ // Launch elevated on Win8 to be able to inject Alt+Tab.
+ bool launch_elevated = base::win::GetVersion() >= base::win::VERSION_WIN8;
+
+ // Get the name of the executable to run. |kDesktopBinaryName| specifies
+ // uiAccess="true" in it's manifest.
base::FilePath desktop_binary;
- if (!GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary)) {
+ bool result;
+ if (launch_elevated) {
+ result = GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary);
+ } else {
+ result = GetInstalledBinaryPath(kHostBinaryName, &desktop_binary);
+ }
+
+ if (!result) {
OnPermanentError();
return;
}
@@ -530,13 +542,17 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) {
// Create a delegate capable of launching a process in a different session.
scoped_ptr<WtsSessionProcessDelegate> delegate(
- new WtsSessionProcessDelegate(
- caller_task_runner_, io_task_runner_, target.Pass(), session_id, true,
- WideToUTF8(kDaemonIpcSecurityDescriptor)));
+ new WtsSessionProcessDelegate(io_task_runner_,
+ target.Pass(),
+ launch_elevated,
+ WideToUTF8(kDaemonIpcSecurityDescriptor)));
+ if (!delegate->Initialize(session_id)) {
+ OnPermanentError();
+ return;
+ }
// Create a launcher for the desktop process, using the per-session delegate.
- launcher_.reset(new WorkerProcessLauncher(
- caller_task_runner_, delegate.Pass(), this));
+ launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this));
}
void DesktopSessionWin::OnSessionDetached() {
« no previous file with comments | « remoting/host/daemon_process_win.cc ('k') | remoting/host/host_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698