0

SAS-related class cleanup

Updating sas_injector_win to current coding standards.
Removing unused member from SessionInputInjectorWin.

Change-Id: I725cf9a549eb40b83eb4ac433387b4423c39e8e0
Reviewed-on: https://chromium-review.googlesource.com/c/1269180
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597651}
This commit is contained in:
Joe Downing
2018-10-08 19:46:24 +00:00
committed by Commit Bot
parent 4573dbe436
commit dbffadb3cc
2 changed files with 8 additions and 12 deletions

@ -7,9 +7,11 @@
#include <windows.h>
#include <sas.h>
#include <memory>
#include <utility>
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/win/registry.h"
namespace remoting {
@ -38,14 +40,12 @@ class ScopedSoftwareSasPolicy {
base::win::RegKey system_policy_;
// True if the policy needs to be restored.
bool restore_policy_;
bool restore_policy_ = false;
DISALLOW_COPY_AND_ASSIGN(ScopedSoftwareSasPolicy);
};
ScopedSoftwareSasPolicy::ScopedSoftwareSasPolicy()
: restore_policy_(false) {
}
ScopedSoftwareSasPolicy::ScopedSoftwareSasPolicy() = default;
ScopedSoftwareSasPolicy::~ScopedSoftwareSasPolicy() {
// Restore the default policy by deleting the value that we have set.
@ -103,10 +103,9 @@ class SasInjectorWin : public SasInjector {
DISALLOW_COPY_AND_ASSIGN(SasInjectorWin);
};
SasInjectorWin::SasInjectorWin() {}
SasInjectorWin::SasInjectorWin() = default;
SasInjectorWin::~SasInjectorWin() {
}
SasInjectorWin::~SasInjectorWin() = default;
bool SasInjectorWin::InjectSas() {
// Enable software SAS generation by services and send SAS. SAS can still fail
@ -121,7 +120,7 @@ bool SasInjectorWin::InjectSas() {
}
std::unique_ptr<SasInjector> SasInjector::Create() {
return base::WrapUnique(new SasInjectorWin());
return std::make_unique<SasInjectorWin>();
}
} // namespace remoting

@ -94,9 +94,6 @@ class SessionInputInjectorWin::Core
// Used to lock the current session on non-home SKUs of Windows.
base::Closure lock_workstation_;
// Used to inject Secure Attention Sequence on XP.
std::unique_ptr<SasInjector> sas_injector_;
// Keys currently pressed by the client, used to detect key sequences.
std::set<ui::DomCode> pressed_keys_;