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

Unified Diff: components/keyboard_lock/key_event_interceptor_installer.h

Issue 2815023002: [System-Keyboard-Lock] Add KeyboardLockHost and KeyEventInterceptor (Closed)
Patch Set: Resolve review comments 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.h
diff --git a/components/keyboard_lock/key_event_interceptor_installer.h b/components/keyboard_lock/key_event_interceptor_installer.h
new file mode 100644
index 0000000000000000000000000000000000000000..2916f9e335b122ed56354d75b002b9e550bc63fd
--- /dev/null
+++ b/components/keyboard_lock/key_event_interceptor_installer.h
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_
+#define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_
+
+#include "base/macros.h"
+#include "components/keyboard_lock/key_event_interceptor.h"
+
+namespace keyboard_lock {
+
+class KeyboardLockHost;
+
+// Installs itself as the default implementation of KeyEventInterceptor in
+// KeyboardLockHost.
+class KeyEventInterceptorInstaller : public KeyEventInterceptor {
dtapuska 2017/04/21 14:48:33 Can you detail how the implementation of this clas
Hzj_jie 2017/04/21 21:13:09 A typical implementation does not need to take car
+ public:
+ ~KeyEventInterceptorInstaller() override;
+
+ protected:
+ // |host| should outlive this instance.
+ explicit KeyEventInterceptorInstaller(KeyboardLockHost* host);
+ void Install();
dtapuska 2017/04/21 14:48:33 The lifecyle of the install is weird. In that you
Hzj_jie 2017/04/21 21:13:09 The KeyLockHost takes owner-ship of the KeyEventIn
+
+ private:
+ KeyboardLockHost* const host_;
+
+ DISALLOW_COPY_AND_ASSIGN(KeyEventInterceptorInstaller);
+};
+
+} // namespace keyboard_lock
+
+#endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_
« no previous file with comments | « components/keyboard_lock/key_event_interceptor.h ('k') | components/keyboard_lock/key_event_interceptor_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698