Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_ | |
| 6 #define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/keyboard_lock/key_event_interceptor.h" | |
| 10 | |
| 11 namespace keyboard_lock { | |
| 12 | |
| 13 class KeyboardLockHost; | |
| 14 | |
| 15 // Installs itself as the default implementation of KeyEventInterceptor in | |
| 16 // KeyboardLockHost. | |
| 17 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
| |
| 18 public: | |
| 19 ~KeyEventInterceptorInstaller() override; | |
| 20 | |
| 21 protected: | |
| 22 // |host| should outlive this instance. | |
| 23 explicit KeyEventInterceptorInstaller(KeyboardLockHost* host); | |
| 24 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
| |
| 25 | |
| 26 private: | |
| 27 KeyboardLockHost* const host_; | |
| 28 | |
| 29 DISALLOW_COPY_AND_ASSIGN(KeyEventInterceptorInstaller); | |
| 30 }; | |
| 31 | |
| 32 } // namespace keyboard_lock | |
| 33 | |
| 34 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_INSTALLER_H_ | |
| OLD | NEW |