Index: components/keyboard_lock/key_hook_share_wrapper.cc |
diff --git a/components/keyboard_lock/key_hook_share_wrapper.cc b/components/keyboard_lock/key_hook_share_wrapper.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3c11eb161f6e00623f605f78b6f11a281c6693ca |
--- /dev/null |
+++ b/components/keyboard_lock/key_hook_share_wrapper.cc |
@@ -0,0 +1,32 @@ |
+// 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. |
+ |
+#include "components/keyboard_lock/key_hook_share_wrapper.h" |
+ |
+#include <utility> |
+ |
+#include "base/logging.h" |
+ |
+namespace keyboard_lock { |
+ |
+KeyHookShareWrapper::KeyHookShareWrapper(KeyHook* key_hook) |
+ : key_hook_(key_hook) { |
+ DCHECK(key_hook_); |
+} |
+ |
+KeyHookShareWrapper::~KeyHookShareWrapper() = default; |
+ |
+void KeyHookShareWrapper::RegisterKey( |
+ const std::vector<ui::KeyboardCode>& codes, |
+ base::Callback<void(bool)> on_result) { |
+ key_hook_->RegisterKey(codes, std::move(on_result)); |
+} |
+ |
+void KeyHookShareWrapper::UnregisterKey( |
+ const std::vector<ui::KeyboardCode>& codes, |
+ base::Callback<void(bool)> on_result) { |
+ key_hook_->UnregisterKey(codes, std::move(on_result)); |
+} |
+ |
+} // namespace keyboard_lock |