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

Side by Side Diff: components/keyboard_lock/active_key_event_filter_registrar.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_ACTIVE_KEY_EVENT_FILTER_REGISTRAR_H_
6 #define COMPONENTS_KEYBOARD_LOCK_ACTIVE_KEY_EVENT_FILTER_REGISTRAR_H_
7
8 #include <memory>
9
10 #include "components/keyboard_lock/key_event_filter.h"
11 #include "components/keyboard_lock/key_hook_activator.h"
12
13 namespace keyboard_lock {
14
15 class ActiveKeyEventFilterTracker;
16
17 // An implementation of KeyHookActivator to forward requests to |key_hook| and
18 // register / unregister cooresponding key event filter |filter| to |tracker|.
19 class ActiveKeyEventFilterRegistrar final : public KeyHookActivator {
20 public:
21 // |tracker| should outlive |this|.
22 ActiveKeyEventFilterRegistrar(ActiveKeyEventFilterTracker* tracker,
23 std::unique_ptr<KeyHookActivator> key_hook,
24 KeyEventFilter* filter);
25 ~ActiveKeyEventFilterRegistrar() override;
26
27 private:
28 // KeyHookActivator implementations
29 void RegisterKey(const std::vector<ui::KeyboardCode>& codes,
30 base::Callback<void(bool)> on_result) override;
31 void UnregisterKey(const std::vector<ui::KeyboardCode>& codes,
32 base::Callback<void(bool)> on_result) override;
33 void Activate(base::Callback<void(bool)> on_result) override;
34 void Deactivate(base::Callback<void(bool)> on_result) override;
35
36 ActiveKeyEventFilterTracker* const tracker_;
37 std::unique_ptr<KeyHookActivator> key_hook_;
38 KeyEventFilter* const filter_;
39 };
40
41 } // namespace keyboard_lock
42
43 #endif // COMPONENTS_KEYBOARD_LOCK_ACTIVE_KEY_EVENT_FILTER_REGISTRAR_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/active_key_event_filter.cc ('k') | components/keyboard_lock/active_key_event_filter_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698