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 #include "components/keyboard_lock/key_hook_share_wrapper.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 #include "base/logging.h" |
| 10 |
| 11 namespace keyboard_lock { |
| 12 |
| 13 KeyHookShareWrapper::KeyHookShareWrapper(KeyHook* key_hook) |
| 14 : key_hook_(key_hook) { |
| 15 DCHECK(key_hook_); |
| 16 } |
| 17 |
| 18 KeyHookShareWrapper::~KeyHookShareWrapper() = default; |
| 19 |
| 20 void KeyHookShareWrapper::RegisterKey( |
| 21 const std::vector<ui::KeyboardCode>& codes, |
| 22 base::Callback<void(bool)> on_result) { |
| 23 key_hook_->RegisterKey(codes, std::move(on_result)); |
| 24 } |
| 25 |
| 26 void KeyHookShareWrapper::UnregisterKey( |
| 27 const std::vector<ui::KeyboardCode>& codes, |
| 28 base::Callback<void(bool)> on_result) { |
| 29 key_hook_->UnregisterKey(codes, std::move(on_result)); |
| 30 } |
| 31 |
| 32 } // namespace keyboard_lock |
OLD | NEW |