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_WIDGET_KEY_EVENT_FILTER_H_ |
| 6 #define COMPONENTS_KEYBOARD_LOCK_WIDGET_KEY_EVENT_FILTER_H_ |
| 7 |
| 8 #include "components/keyboard_lock/key_event_filter.h" |
| 9 |
| 10 namespace content { |
| 11 class WebContents; |
| 12 class RenderWidgetHost; |
| 13 } // namespace |
| 14 |
| 15 namespace keyboard_lock { |
| 16 |
| 17 // An implementation of KeyEventFilter to forward key events to the |
| 18 // RenderWidgetHost. |
| 19 class WidgetKeyEventFilter : public KeyEventFilter { |
| 20 public: |
| 21 explicit WidgetKeyEventFilter(const content::WebContents* contents); |
| 22 ~WidgetKeyEventFilter() override; |
| 23 |
| 24 private: |
| 25 // KeyEventFilter implementations |
| 26 bool OnKeyDown(ui::KeyboardCode code, int flags) override; |
| 27 bool OnKeyUp(ui::KeyboardCode code, int flags) override; |
| 28 |
| 29 content::RenderWidgetHost* const host_; |
| 30 }; |
| 31 |
| 32 } // namespace keyboard_lock |
| 33 |
| 34 #endif // COMPONENTS_KEYBOARD_LOCK_WIDGET_KEY_EVENT_FILTER_H_ |
OLD | NEW |