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

Unified Diff: remoting/host/win/session_event_executor.cc

Issue 11364112: Merge 165565 - Calling SendSAS() from a service to make sure that Secure Attention Sequence can be … (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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/win/session_event_executor.h ('k') | remoting/host/win/wts_console_session_process_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/session_event_executor.cc
===================================================================
--- remoting/host/win/session_event_executor.cc (revision 166306)
+++ remoting/host/win/session_event_executor.cc (working copy)
@@ -41,13 +41,17 @@
using protocol::KeyEvent;
SessionEventExecutorWin::SessionEventExecutorWin(
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
- scoped_ptr<EventExecutor> nested_executor)
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_ptr<EventExecutor> nested_executor,
+ scoped_refptr<base::SingleThreadTaskRunner> inject_sas_task_runner,
+ const base::Closure& inject_sas)
: nested_executor_(nested_executor.Pass()),
- task_runner_(main_task_runner),
+ input_task_runner_(input_task_runner),
+ inject_sas_task_runner_(inject_sas_task_runner),
+ inject_sas_(inject_sas),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)),
weak_ptr_(weak_ptr_factory_.GetWeakPtr()) {
- // Let |weak_ptr_| be used on the |task_runner_| thread.
+ // Let |weak_ptr_| be used on the |input_task_runner_| thread.
// |weak_ptr_| and |weak_ptr_factory_| share a ThreadChecker, so the
// following line affects both of them.
weak_ptr_factory_.DetachFromThread();
@@ -58,8 +62,8 @@
void SessionEventExecutorWin::Start(
scoped_ptr<protocol::ClipboardStub> client_clipboard) {
- if (!task_runner_->BelongsToCurrentThread()) {
- task_runner_->PostTask(
+ if (!input_task_runner_->BelongsToCurrentThread()) {
+ input_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SessionEventExecutorWin::Start,
weak_ptr_, base::Passed(&client_clipboard)));
@@ -70,8 +74,8 @@
}
void SessionEventExecutorWin::StopAndDelete() {
- if (!task_runner_->BelongsToCurrentThread()) {
- task_runner_->PostTask(
+ if (!input_task_runner_->BelongsToCurrentThread()) {
+ input_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SessionEventExecutorWin::StopAndDelete,
weak_ptr_));
@@ -84,8 +88,8 @@
void SessionEventExecutorWin::InjectClipboardEvent(
const ClipboardEvent& event) {
- if (!task_runner_->BelongsToCurrentThread()) {
- task_runner_->PostTask(
+ if (!input_task_runner_->BelongsToCurrentThread()) {
+ input_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SessionEventExecutorWin::InjectClipboardEvent,
weak_ptr_, event));
@@ -96,8 +100,8 @@
}
void SessionEventExecutorWin::InjectKeyEvent(const KeyEvent& event) {
- if (!task_runner_->BelongsToCurrentThread()) {
- task_runner_->PostTask(
+ if (!input_task_runner_->BelongsToCurrentThread()) {
+ input_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SessionEventExecutorWin::InjectKeyEvent,
weak_ptr_, event));
@@ -114,9 +118,14 @@
CheckCtrlAndAltArePressed(pressed_keys_)) {
VLOG(3) << "Sending Secure Attention Sequence to console";
- if (sas_injector_.get() == NULL)
- sas_injector_ = SasInjector::Create();
- sas_injector_->InjectSas();
+ if (base::win::GetVersion() < base::win::VERSION_VISTA) {
+ if (!sas_injector_)
+ sas_injector_ = SasInjector::Create();
+ if (!sas_injector_->InjectSas())
+ LOG(ERROR) << "Failed to inject Secure Attention Sequence.";
+ } else {
+ inject_sas_task_runner_->PostTask(FROM_HERE, inject_sas_);
+ }
}
pressed_keys_.insert(event.usb_keycode());
@@ -130,8 +139,8 @@
}
void SessionEventExecutorWin::InjectMouseEvent(const MouseEvent& event) {
- if (!task_runner_->BelongsToCurrentThread()) {
- task_runner_->PostTask(
+ if (!input_task_runner_->BelongsToCurrentThread()) {
+ input_task_runner_->PostTask(
FROM_HERE,
base::Bind(&SessionEventExecutorWin::InjectMouseEvent,
weak_ptr_, event));
« no previous file with comments | « remoting/host/win/session_event_executor.h ('k') | remoting/host/win/wts_console_session_process_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698