Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: components/keyboard_lock/key_hook.h

Issue 2879033002: Keyboard Lock Host implementation
Patch Set: Remove useless files Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_HOOK_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "ui/events/keycodes/keyboard_codes.h"
12
13 namespace keyboard_lock {
14
15 // An interface to register and unregister key codes from low level callback.
16 // The implementation needs to guarantee the thread-safety of RegisterKey() and
17 // UnregisterKey() functions, which may be executed in both UI thread and
18 // network thread.
19 class KeyHook {
20 public:
21 KeyHook() = default;
22 virtual ~KeyHook() = default;
23
24 // The |on_result| callback will be called with the result if it's not null.
25 // Calling |on_result| with |false| indicates the failure of an OK API
26 // invoking. Thus, the required ui::KeyboardCode may not be able to received.
27 virtual void RegisterKey(const std::vector<ui::KeyboardCode>& codes,
28 base::Callback<void(bool)> on_result) = 0;
29 virtual void UnregisterKey(const std::vector<ui::KeyboardCode>& codes,
30 base::Callback<void(bool)> on_result) = 0;
31 };
32
33 } // namespace keyboard_lock
34
35 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/key_event_filter_thread_proxy.cc ('k') | components/keyboard_lock/key_hook_activator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698