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

Unified Diff: remoting/host/desktop_process.cc

Issue 1930473003: Adding support for Win+L key combo in Windows host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing a non-windows build break Created 4 years, 8 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
Index: remoting/host/desktop_process.cc
diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process.cc
index 525e1f66bb73b54783c6d3f78c2147e4ec8be031..a621ed2587f22925768df3ae314b113eb68f3d1e 100644
--- a/remoting/host/desktop_process.cc
+++ b/remoting/host/desktop_process.cc
@@ -16,6 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
+#include "base/win/windows_version.h"
Jamie 2016/04/29 00:41:42 Does this also need an ifdef?
joedow 2016/04/29 16:13:09 Done.
#include "build/build_config.h"
#include "ipc/attachment_broker_unprivileged.h"
#include "ipc/ipc_channel_proxy.h"
@@ -61,6 +62,22 @@ void DesktopProcess::InjectSas() {
daemon_channel_->Send(new ChromotingDesktopDaemonMsg_InjectSas());
}
+void DesktopProcess::LockWorkStation() {
+ DCHECK(caller_task_runner_->BelongsToCurrentThread());
+#if defined(OS_WIN)
+ if (base::win::OSInfo::GetInstance()->version_type() ==
+ base::win::VersionType::SUITE_HOME) {
+ return;
+ }
+
+ if (!::LockWorkStation()) {
+ LOG(ERROR) << "LockWorkStation() failed: " << ::GetLastError();
+ }
+#else
+ NOTIMPLEMENTED();
Jamie 2016/04/29 00:41:42 Maybe NOTREACHED would be more appropriate here?
joedow 2016/04/29 16:13:09 Done.
+#endif // defined(OS_WIN)
+}
Jamie 2016/04/28 22:00:11 I think this needs to factored out more cleanly in
joedow 2016/04/29 16:13:09 Acknowledged.
+
bool DesktopProcess::OnMessageReceived(const IPC::Message& message) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698