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

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

Issue 2815023002: [System-Keyboard-Lock] Add KeyboardLockHost and KeyEventInterceptor (Closed)
Patch Set: Resolve review comments Created 3 years, 8 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_INTERCEPTOR_H_
6 #define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_H_
7
8 #include "ui/events/keycodes/keyboard_codes.h"
9
10 namespace keyboard_lock {
11
12 // An interface to receive and process a key event.
13 class KeyEventInterceptor {
14 public:
15 KeyEventInterceptor() = default;
16 virtual ~KeyEventInterceptor() = default;
17
18 virtual bool OnKeyDown(ui::KeyboardCode code) = 0;
19 virtual bool OnKeyUp(ui::KeyboardCode code) = 0;
20
21 // An interface to retrieve a KeyEventInterceptor instance. This class is used
22 // to avoid the dependency of the singleton object of KeyboardLockHost, and to
23 // ensure late installed KeyEventInterceptor can be retrieved.
24 class Retriever {
25 public:
26 Retriever() = default;
27 virtual ~Retriever() = default;
28
29 // May return nullptr.
30 virtual KeyEventInterceptor* Get() = 0;
31 };
32 };
33
34 } // namespace keyboard_lock
35
36 #endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698