| 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 CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "ui/events/event_handler.h" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 // When Switch Access is enabled, intercepts a few keys before the rest of the |
| 14 // OS has a chance to handle them, as a method for controlling the entire OS |
| 15 // with a small number of switches. The key events do not propagate to the rest |
| 16 // of the system. |
| 17 // |
| 18 // This class just intercepts the keys and forwards them to the component |
| 19 // extension. |
| 20 class SwitchAccessEventHandler : public ui::EventHandler { |
| 21 public: |
| 22 SwitchAccessEventHandler(); |
| 23 ~SwitchAccessEventHandler() override; |
| 24 |
| 25 private: |
| 26 // EventHandler: |
| 27 void OnKeyEvent(ui::KeyEvent* event) override; |
| 28 |
| 29 void CancelEvent(ui::Event* event); |
| 30 void DispatchKeyEventToSwitchAccess(const ui::KeyEvent& event); |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(SwitchAccessEventHandler); |
| 33 }; |
| 34 |
| 35 } // namespace chromeos |
| 36 |
| 37 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_ |
| OLD | NEW |