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

Unified Diff: remoting/host/session_event_executor_win.cc

Issue 10836224: [Chromoting] Call SendSAS() directly from the host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and made it work. Created 8 years, 4 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/session_event_executor_win.h ('k') | remoting/host/win/wts_session_process_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/session_event_executor_win.cc
diff --git a/remoting/host/session_event_executor_win.cc b/remoting/host/session_event_executor_win.cc
index aff6a7dcde9cffeb79eed720466260ba6240bbf3..617a38146871ef2d4a338865996a681ff5c6646f 100644
--- a/remoting/host/session_event_executor_win.cc
+++ b/remoting/host/session_event_executor_win.cc
@@ -14,15 +14,12 @@
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "remoting/host/chromoting_messages.h"
+#include "remoting/host/sas_injector.h"
#include "remoting/host/win/desktop.h"
-#include "remoting/host/win/scoped_thread_desktop.h"
#include "remoting/proto/event.pb.h"
namespace {
-// The command line switch specifying the name of the Chromoting IPC channel.
-const char kProcessChannelId[] = "chromoting-ipc";
-
const uint32 kUsbLeftControl = 0x0700e0;
const uint32 kUsbRightControl = 0x0700e4;
const uint32 kUsbLeftAlt = 0x0700e2;
@@ -38,33 +35,6 @@ bool CheckCtrlAndAltArePressed(const std::set<uint32>& pressed_keys) {
(ctrl_keys + alt_keys == pressed_keys.size());
}
-// Emulates Secure Attention Sequence (Ctrl+Alt+Del) by switching to
-// the Winlogon desktop and injecting Ctrl+Alt+Del as a hot key.
-// N.B. Windows XP/W2K3 only.
-void EmulateSecureAttentionSequence() {
- const wchar_t kWinlogonDesktopName[] = L"Winlogon";
- const wchar_t kSasWindowClassName[] = L"SAS window class";
- const wchar_t kSasWindowTitle[] = L"SAS window";
-
- scoped_ptr<remoting::Desktop> winlogon_desktop(
- remoting::Desktop::GetDesktop(kWinlogonDesktopName));
- if (!winlogon_desktop.get())
- return;
-
- remoting::ScopedThreadDesktop desktop;
- if (!desktop.SetThreadDesktop(winlogon_desktop.Pass()))
- return;
-
- HWND window = FindWindow(kSasWindowClassName, kSasWindowTitle);
- if (!window)
- return;
-
- PostMessage(window,
- WM_HOTKEY,
- 0,
- MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));
-}
-
} // namespace
namespace remoting {
@@ -85,16 +55,6 @@ SessionEventExecutorWin::SessionEventExecutorWin(
// |weak_ptr_| and |weak_ptr_factory_| share a ThreadChecker, so the
// following line affects both of them.
weak_ptr_factory_.DetachFromThread();
-
- std::string channel_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kProcessChannelId);
-
- // Connect to the Chromoting IPC channel if the name was passed in the command
- // line.
- if (!channel_name.empty()) {
- chromoting_channel_.reset(new IPC::ChannelProxy(
- channel_name, IPC::Channel::MODE_CLIENT, this, io_task_runner));
- }
}
SessionEventExecutorWin::~SessionEventExecutorWin() {
@@ -157,11 +117,9 @@ void SessionEventExecutorWin::InjectKeyEvent(const KeyEvent& event) {
CheckCtrlAndAltArePressed(pressed_keys_)) {
VLOG(3) << "Sending Secure Attention Sequence to console";
- if (base::win::GetVersion() == base::win::VERSION_XP) {
- EmulateSecureAttentionSequence();
- } else if (chromoting_channel_.get()) {
- chromoting_channel_->Send(new ChromotingHostMsg_SendSasToConsole());
- }
+ if (sas_injector_.get() == NULL)
+ sas_injector_ = SasInjector::Create();
+ sas_injector_->InjectSas();
}
pressed_keys_.insert(event.usb_keycode());
@@ -187,10 +145,6 @@ void SessionEventExecutorWin::InjectMouseEvent(const MouseEvent& event) {
nested_executor_->InjectMouseEvent(event);
}
-bool SessionEventExecutorWin::OnMessageReceived(const IPC::Message& message) {
- return false;
-}
-
void SessionEventExecutorWin::SwitchToInputDesktop() {
// Switch to the desktop receiving user input if different from the current
// one.
« no previous file with comments | « remoting/host/session_event_executor_win.h ('k') | remoting/host/win/wts_session_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698