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

Side by Side Diff: components/keyboard_lock/key_hook_activator_thread_proxy.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_ACTIVITOR_THREAD_PROXY_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVITOR_THREAD_PROXY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/single_thread_task_runner.h"
10 #include "components/keyboard_lock/key_hook_activator.h"
11
12 namespace keyboard_lock {
13
14 // An implementation of KeyHookActivator to forward requests to |runner|.
15 class KeyHookActivatorThreadProxy final : public KeyHookActivator {
16 public:
17 // |key_hook| should never be destroyed.
18 KeyHookActivatorThreadProxy(
19 KeyHookActivator* const key_hook,
20 scoped_refptr<base::SingleThreadTaskRunner> runner);
21 ~KeyHookActivatorThreadProxy() override;
22
23 // KeyHookActivator implementations.
24 void RegisterKey(const std::vector<ui::KeyboardCode>& codes,
25 base::Callback<void(bool)> on_result) override;
26 void UnregisterKey(const std::vector<ui::KeyboardCode>& codes,
27 base::Callback<void(bool)> on_result) override;
28 void Activate(base::Callback<void(bool)> on_result) override;
29 void Deactivate(base::Callback<void(bool)> on_result) override;
30
31 private:
32 KeyHookActivator* const key_hook_;
33 const scoped_refptr<base::SingleThreadTaskRunner> runner_;
34 };
35
36 } // namespace keyboard_lock
37
38 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVITOR_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/key_hook_activator_collection.cc ('k') | components/keyboard_lock/key_hook_activator_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698