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

Unified Diff: chrome/browser/ui/ash/event_rewriter.h

Issue 155493002: Add key based scrolling on magnified screen for kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/ui/ash/event_rewriter.h
diff --git a/chrome/browser/ui/ash/event_rewriter.h b/chrome/browser/ui/ash/event_rewriter.h
index f08507582a83135d4e6027e22b6762f449777bf4..0747bdce2719b491954efef67fe0acfec57155e7 100644
--- a/chrome/browser/ui/ash/event_rewriter.h
+++ b/chrome/browser/ui/ash/event_rewriter.h
@@ -31,6 +31,7 @@ class RootWindow;
namespace chromeos {
class KeyboardDrivenEventRewriter;
+class AccessibilityEventRewriter;
namespace input_method {
class XKeyboard;
@@ -158,7 +159,7 @@ class EventRewriter : public ash::EventRewriterDelegate,
const PrefService* GetPrefService() const;
// Rewrites the |event| by applying all RewriteXXX functions as needed.
- void Rewrite(ui::KeyEvent* event);
+ ash::EventRewriterDelegate::Action Rewrite(ui::KeyEvent* event);
// Rewrites a modifier key press/release following the current user
// preferences.
@@ -197,12 +198,12 @@ class EventRewriter : public ash::EventRewriterDelegate,
// Rewrites the located |event|.
void RewriteLocatedEvent(ui::LocatedEvent* event);
- // Overwrites |event| with the keycodes and flags.
- void OverwriteEvent(ui::KeyEvent* event,
- unsigned int new_native_keycode,
- unsigned int new_native_state,
- ui::KeyboardCode new_keycode,
- int new_flags);
+ // Rewrites the event for accessibility.
+ // * Press and Hold [Shift+{Up/Down/Left/Right} -> Shift+NUMPAD{6789}
+ // * Release[Shift+{Up/Down/Left/Right}] -> Shift+{Up/Down/Left/Right}
+ bool RewriteAccessibilityKeys(
+ ui::KeyEvent* event,
+ ash::EventRewriterDelegate::Action* action);
// Checks the type of the |device_name|, and inserts a new entry to
// |device_id_to_type_|.
@@ -218,10 +219,20 @@ class EventRewriter : public ash::EventRewriterDelegate,
int* remapped_flags,
unsigned int* remapped_native_modifiers) const;
+ // Overwrites |event| with the keycodes and flags.
+ static void OverwriteEvent(ui::KeyEvent* event,
+ unsigned int new_native_keycode,
+ unsigned int new_native_state,
+ ui::KeyboardCode new_keycode,
+ int new_flags);
+
std::map<int, DeviceType> device_id_to_type_;
int last_device_id_;
#if defined(OS_CHROMEOS)
+ class AccessibilityEventRewriter;
+ friend class AccessibilityEventRewriter;
+
// A mapping from X11 KeySym keys to KeyCode values.
base::hash_map<unsigned long, unsigned long> keysym_to_keycode_map_;
@@ -232,6 +243,9 @@ class EventRewriter : public ash::EventRewriterDelegate,
scoped_ptr<chromeos::KeyboardDrivenEventRewriter>
keyboard_driven_event_rewriter_;
+
+ scoped_ptr<AccessibilityEventRewriter>
+ accessibility_event_rewriter_;
#endif
const PrefService* pref_service_for_testing_;

Powered by Google App Engine
This is Rietveld 408576698