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

Unified Diff: chrome/browser/chromeos/accessibility/switch_access_event_handler.h

Issue 2711343005: Set keys to traverse accessibility tree. Using focus ring to highlight selected node. (Closed)
Patch Set: Fixing closure compilation error Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/switch_access_event_handler.h
diff --git a/chrome/browser/chromeos/accessibility/switch_access_event_handler.h b/chrome/browser/chromeos/accessibility/switch_access_event_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..331f8363bbe4ae99c1e9284979c711a4db0cae68
--- /dev/null
+++ b/chrome/browser/chromeos/accessibility/switch_access_event_handler.h
@@ -0,0 +1,37 @@
+// 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 CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_
+#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_
+
+#include "base/macros.h"
+#include "ui/events/event_handler.h"
+
+namespace chromeos {
+
+// When Switch Access is enabled, intercepts a few keys before the rest of the
+// OS has a chance to handle them, as a method for controlling the entire OS
+// with a small number of switches. The key events do not propagate to the rest
+// of the system.
+//
+// This class just intercepts the keys and forwards them to the component
+// extension.
+class SwitchAccessEventHandler : public ui::EventHandler {
+ public:
+ SwitchAccessEventHandler();
+ ~SwitchAccessEventHandler() override;
+
+ private:
+ // EventHandler:
+ void OnKeyEvent(ui::KeyEvent* event) override;
+
+ void CancelEvent(ui::Event* event);
+ void DispatchKeyEventToSwitchAccess(const ui::KeyEvent& event);
+
+ DISALLOW_COPY_AND_ASSIGN(SwitchAccessEventHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SWITCH_ACCESS_EVENT_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698