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

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

Issue 2815023002: [System-Keyboard-Lock] Add KeyboardLockHost and KeyEventInterceptor (Closed)
Patch Set: Use NativeKeycode instead of ui::KeyboardCode Created 3 years, 6 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
« no previous file with comments | « components/keyboard_lock/OWNERS ('k') | components/keyboard_lock/keyboard_lock_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_FILTER_H_
7
8 #include "components/keyboard_lock/keyboard_lock_types.h"
9
10 namespace keyboard_lock {
11
12 // An interface to receive and process a key event. The implementation needs to
13 // guarantee the thread-safety of OnKeyDown() and OnKeyUp() functions, which may
14 // be executed in an unpredictable thread.
15 class KeyEventFilter {
16 public:
17 KeyEventFilter() = default;
18 virtual ~KeyEventFilter() = default;
19
20 // Returns true if the |code| should be suppressed.
21 virtual bool OnKeyDown(NativeKeycode code) = 0;
22
23 // REturns true if the |code| should be suppressed.
24 virtual bool OnKeyUp(NativeKeycode code) = 0;
25 };
26
27 } // namespace keyboard_lock
28
29 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_FILTER_H_
OLDNEW
« no previous file with comments | « components/keyboard_lock/OWNERS ('k') | components/keyboard_lock/keyboard_lock_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698