| Index: components/keyboard_lock/key_event_interceptor.h
|
| diff --git a/components/keyboard_lock/key_event_interceptor.h b/components/keyboard_lock/key_event_interceptor.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..573626179075ad8a380a13b3b95027ae6f664e59
|
| --- /dev/null
|
| +++ b/components/keyboard_lock/key_event_interceptor.h
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_H_
|
| +#define COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_H_
|
| +
|
| +#include "ui/events/keycodes/keyboard_codes.h"
|
| +
|
| +namespace keyboard_lock {
|
| +
|
| +// An interface to receive and process a key event.
|
| +class KeyEventInterceptor {
|
| + public:
|
| + KeyEventInterceptor() = default;
|
| + virtual ~KeyEventInterceptor() = default;
|
| +
|
| + virtual bool OnKeyDown(ui::KeyboardCode code) = 0;
|
| + virtual bool OnKeyUp(ui::KeyboardCode code) = 0;
|
| +
|
| + // An interface to retrieve a KeyEventInterceptor instance. This class is used
|
| + // to avoid the dependency of the singleton object of KeyboardLockHost, and to
|
| + // ensure late installed KeyEventInterceptor can be retrieved.
|
| + class Retriever {
|
| + public:
|
| + Retriever() = default;
|
| + virtual ~Retriever() = default;
|
| +
|
| + // May return nullptr.
|
| + virtual KeyEventInterceptor* Get() = 0;
|
| + };
|
| +};
|
| +
|
| +} // namespace keyboard_lock
|
| +
|
| +#endif // COMPONENTS_KEYBOARD_LOCK_KEY_EVENT_INTERCEPTOR_H_
|
|
|