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

Side by Side Diff: components/keyboard_lock/key_hook_activator.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_ACTIVATOR_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVATOR_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "components/keyboard_lock/key_hook.h"
12 #include "ui/events/keycodes/keyboard_codes.h"
13
14 namespace keyboard_lock {
15
16 // An interface to store all registered key codes and register or unregister
17 // them with one Activate() or Deactivate() function call.
18 // The implementation needs to guarantee the thread-safety of Activate() and
19 // Deactivate() functions, which may be executed in both UI thread and
20 // network thread.
21 class KeyHookActivator : public KeyHook {
22 public:
23 KeyHookActivator() = default;
24 ~KeyHookActivator() override = default;
25
26 // Meaning of |on_result| is same as the one in KeyHook::RegisterKey().
27
28 // Enables all registered key codes.
29 virtual void Activate(base::Callback<void(bool)> on_result) = 0;
30
31 // Disables all registered key codes.
32 virtual void Deactivate(base::Callback<void(bool)> on_result) = 0;
33 };
34
35 } // namespace keyboard_lock
36
37 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVATOR_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/key_hook.h ('k') | components/keyboard_lock/key_hook_activator_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698