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

Unified Diff: components/keyboard_lock/key_event_interceptor_installer.cc

Issue 2815023002: [System-Keyboard-Lock] Add KeyboardLockHost and KeyEventInterceptor (Closed)
Patch Set: Created 3 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: components/keyboard_lock/key_event_interceptor_installer.cc
diff --git a/components/keyboard_lock/key_event_interceptor_installer.cc b/components/keyboard_lock/key_event_interceptor_installer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5ac658f5ff2f6492dd213f13c579bd965acb5f0b
--- /dev/null
+++ b/components/keyboard_lock/key_event_interceptor_installer.cc
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/keyboard_lock/key_event_interceptor_installer.h"
+
+#include <memory>
+
+#include "base/logging.h"
+#include "components/keyboard_lock/keyboard_lock_host.h"
+
+namespace keyboard_lock {
+
+KeyEventInterceptorInstaller::KeyEventInterceptorInstaller(
+ KeyboardLockHost* host) {
+ DCHECK(host);
+ host->SetKeyEventInterceptor(std::unique_ptr<KeyEventInterceptor>(this));
dtapuska 2017/04/18 13:43:17 I'd think this is dangerous. What happens if the S
Hzj_jie 2017/04/19 00:46:26 Done. Good point, I have not considered this possi
+}
+
+KeyEventInterceptorInstaller::~KeyEventInterceptorInstaller() = default;
+
+} // namespace keyboard_lock

Powered by Google App Engine
This is Rietveld 408576698