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/sync_key_hook.h" |
| 6 |
| 7 namespace keyboard_lock { |
| 8 |
| 9 SyncKeyHook::SyncKeyHook() = default; |
| 10 SyncKeyHook::~SyncKeyHook() = default; |
| 11 |
| 12 void SyncKeyHook::RegisterKey(const std::vector<ui::KeyboardCode>& codes, |
| 13 base::Callback<void(bool)> on_result) { |
| 14 bool result = RegisterKey(codes); |
| 15 if (on_result) { |
| 16 on_result.Run(result); |
| 17 } |
| 18 } |
| 19 |
| 20 void SyncKeyHook::UnregisterKey(const std::vector<ui::KeyboardCode>& codes, |
| 21 base::Callback<void(bool)> on_result) { |
| 22 bool result = UnregisterKey(codes); |
| 23 if (on_result) { |
| 24 on_result.Run(result); |
| 25 } |
| 26 } |
| 27 |
| 28 } // namespace keyboard_lock |
OLD | NEW |