OLD | NEW |
(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_ACTIVE_KEY_EVENT_FILTER_H_ |
| 6 #define COMPONENTS_KEYBOARD_LOCK_ACTIVE_KEY_EVENT_FILTER_H_ |
| 7 |
| 8 #include "components/keyboard_lock/key_event_filter.h" |
| 9 |
| 10 namespace keyboard_lock { |
| 11 |
| 12 class ActiveKeyEventFilterTracker; |
| 13 |
| 14 // A KeyEventFilter implementation to forward the key events to the active |
| 15 // KeyEventFilter in |tracker|. |
| 16 class ActiveKeyEventFilter final : public KeyEventFilter { |
| 17 public: |
| 18 // |tracker| must outlive |this|. |
| 19 ActiveKeyEventFilter(const ActiveKeyEventFilterTracker* tracker); |
| 20 ~ActiveKeyEventFilter() override; |
| 21 |
| 22 private: |
| 23 // KeyEventFilter implementations. |
| 24 bool OnKeyDown(ui::KeyboardCode code, int flags) override; |
| 25 bool OnKeyUp(ui::KeyboardCode code, int flags) override; |
| 26 |
| 27 const ActiveKeyEventFilterTracker* const tracker_; |
| 28 }; |
| 29 |
| 30 } // namespace keyboard_lock |
| 31 |
| 32 #endif // COMPONENTS_KEYBOARD_LOCK_ACTIVE_KEY_EVENT_FILTER_H_ |
OLD | NEW |