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_ |