Chromium Code Reviews| Index: remoting/host/win/wts_console_session_process_driver.cc |
| diff --git a/remoting/host/win/wts_console_session_process_driver.cc b/remoting/host/win/wts_console_session_process_driver.cc |
| index b77cfccdb309c346dfe9ce3c6030ba52ab2c9bbe..597f07456aef5e2f67cf45077cb4194d968fd464 100644 |
| --- a/remoting/host/win/wts_console_session_process_driver.cc |
| +++ b/remoting/host/win/wts_console_session_process_driver.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| #include "base/single_thread_task_runner.h" |
| +#include "base/win/windows_version.h" |
| #include "ipc/ipc_message.h" |
| #include "ipc/ipc_message_macros.h" |
| #include "remoting/host/chromoting_messages.h" |
| @@ -89,9 +90,19 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { |
| DCHECK(launcher_.get() == NULL); |
| - // Get the host binary name. |
| + // Launch elevated on Win8 to be able to inject Alt+Tab. |
|
garykac
2013/05/15 23:24:30
Is it worth sharing this code with desktop_session
alexeypa (please no reviews)
2013/05/16 17:50:04
WtsConsoleSessionProcessDriver is not used any mor
|
| + bool launch_elevated = base::win::GetVersion() >= base::win::VERSION_WIN8; |
| + |
| + // Get the name of the executable the desktop process will run. |
| 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) { |
| Stop(); |
| return; |
| } |
| @@ -104,16 +115,17 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { |
| // Create a Delegate capable of launching an elevated process in the session. |
| scoped_ptr<WtsSessionProcessDelegate> delegate( |
| - new WtsSessionProcessDelegate(caller_task_runner_, |
| - io_task_runner_, |
| + new WtsSessionProcessDelegate(io_task_runner_, |
| target.Pass(), |
| - session_id, |
| - true, |
| + launch_elevated, |
| kDaemonIpcSecurityDescriptor)); |
| + if (!delegate->Initialize(session_id)) { |
| + Stop(); |
| + return; |
| + } |
| // Use the Delegate to launch the host process. |
| - launcher_.reset(new WorkerProcessLauncher( |
| - caller_task_runner_, delegate.Pass(), this)); |
| + launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this)); |
| } |
| void WtsConsoleSessionProcessDriver::OnSessionDetached() { |