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

Side by Side Diff: components/keyboard_lock/key_event_filter_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_EVENT_FILTER_THREAD_PROXY_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_FILTER_THREAD_PROXY_H_
7
8 #include <memory>
9
10 #include "base/memory/ref_counted.h"
11 #include "components/keyboard_lock/key_event_filter.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15 } // namespace base
16
17 namespace keyboard_lock {
18
19 // TODO(zijiehe): Is this class necessary? i.e. Is it needed to forward
20 // RenderWidgetHost::ForwardKeyboardEvent() to network thread?
21 // An implementation of KeyEventFilter to forward all requests to |runner| and
22 // |filter|.
23 class KeyEventFilterThreadProxy : public KeyEventFilter {
24 public:
25 KeyEventFilterThreadProxy(
26 scoped_refptr<base::SingleThreadTaskRunner> runner,
27 std::unique_ptr<KeyEventFilter> filter);
28 ~KeyEventFilterThreadProxy() override;
29
30 private:
31 // KeyEventFilter implementations
32 // Because the requests will be sent to a different thread, these functions
33 // always return true.
34 bool OnKeyDown(ui::KeyboardCode code, int flags) override;
35 bool OnKeyUp(ui::KeyboardCode code, int flags) override;
36
37 const scoped_refptr<base::SingleThreadTaskRunner> runner_;
38 const std::unique_ptr<KeyEventFilter> filter_;
39 };
40
41 } // namespace keyboard_lock
42
43 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_FILTER_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/key_event_filter_share_wrapper.cc ('k') | components/keyboard_lock/key_event_filter_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698