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_SYNC_KEY_HOOK_H_ |
| 6 #define COMPONENTS_KEYBOARD_LOCK_SYNC_KEY_HOOK_H_ |
| 7 |
| 8 #include "components/keyboard_lock/key_hook.h" |
| 9 |
| 10 namespace keyboard_lock { |
| 11 |
| 12 // An implementation of KeyHook for synchronized implementation, i.e. both |
| 13 // RegisterKey() and UnregisterKey() return synchronizedly. Usually a platform |
| 14 // specific implementation should derived from this class. |
| 15 class SyncKeyHook : public KeyHook { |
| 16 public: |
| 17 SyncKeyHook(); |
| 18 ~SyncKeyHook() override; |
| 19 |
| 20 void RegisterKey(const std::vector<ui::KeyboardCode>& codes, |
| 21 base::Callback<void(bool)> on_result) final; |
| 22 void UnregisterKey(const std::vector<ui::KeyboardCode>& codes, |
| 23 base::Callback<void(bool)> on_result) final; |
| 24 |
| 25 virtual bool RegisterKey(const std::vector<ui::KeyboardCode>& codes) = 0; |
| 26 virtual bool UnregisterKey(const std::vector<ui::KeyboardCode>& codes) = 0; |
| 27 }; |
| 28 |
| 29 } // namespace keyboard_lock |
| 30 |
| 31 #endif // COMPONENTS_KEYBOARD_LOCK_SYNC_KEY_HOOK_H_ |
OLD | NEW |