Index: ash/sticky_keys/sticky_keys_controller.h |
diff --git a/ash/sticky_keys/sticky_keys_controller.h b/ash/sticky_keys/sticky_keys_controller.h |
index 327d7ec2f210f733f229ccb201026a9c0cb1c644..094af78617b1f37878b07bd11d65b233bc2e51e3 100644 |
--- a/ash/sticky_keys/sticky_keys_controller.h |
+++ b/ash/sticky_keys/sticky_keys_controller.h |
@@ -10,6 +10,7 @@ |
#include "ash/ash_export.h" |
#include "ash/sticky_keys/sticky_keys_state.h" |
#include "base/macros.h" |
+#include "ui/chromeos/events/event_rewriter.h" |
#include "ui/events/event_constants.h" |
#include "ui/events/event_handler.h" |
#include "ui/events/event_rewriter.h" |
@@ -59,10 +60,11 @@ class StickyKeysHandler; |
// modifiers. Each handling or state is performed independently. |
// |
// StickyKeysController is disabled by default. |
-class ASH_EXPORT StickyKeysController { |
+class ASH_EXPORT StickyKeysController |
+ : public ui::chromeos::EventRewriter::StickyKeysController { |
public: |
StickyKeysController(); |
- virtual ~StickyKeysController(); |
+ ~StickyKeysController() override; |
// Activate sticky keys to intercept and modify incoming events. |
void Enable(bool enabled); |
@@ -73,40 +75,16 @@ class ASH_EXPORT StickyKeysController { |
// passed. |
StickyKeysOverlay* GetOverlayForTest(); |
- // Handles keyboard event. Returns an |EventRewriteStatus|, and may |
- // modify |flags|: |
- // - Returns ui::EVENT_REWRITE_DISCARD, and leaves |flags| untouched, |
- // if the event is consumed (i.e. a sticky modifier press or release); |
- // - Returns ui::EVENT_REWRITE_REWRITTEN if the event needs to be modified |
- // according to the returned |flags| (i.e. a sticky-modified key); |
- // - Returns ui::EVENT_REWRITE_DISPATCH_ANOTHER if the event needs to be |
- // modified according to the returned |flags|, and there are delayed |
- // modifier-up events now to be retrieved using |NextDispatchEvent()| |
- // (i.e. a sticky-modified key that ends a sticky state); |
- // - Otherwise returns ui::EVENT_REWRITE_CONTINUE and leaves |flags| |
- // unchanged. |
+ // ui::chromeos::StickyKeysController: |
ui::EventRewriteStatus RewriteKeyEvent(const ui::KeyEvent& event, |
ui::KeyboardCode key_code, |
- int* flags); |
- |
- // Handles mouse event. |
+ int* flags) override; |
ui::EventRewriteStatus RewriteMouseEvent(const ui::MouseEvent& event, |
- int* flags); |
- |
- // Handles scroll event. |
+ int* flags) override; |
ui::EventRewriteStatus RewriteScrollEvent(const ui::ScrollEvent& event, |
- int* flags); |
- |
- // Obtains a pending modifier-up event. If the immediately previous |
- // call to |Rewrite...Event()| or |NextDispatchEvent()| returned |
- // ui::EVENT_REWRITE_DISPATCH_ANOTHER, this sets |new_event| and returns: |
- // - ui::EVENT_REWRITE_DISPATCH_ANOTHER if there is at least one more |
- // pending modifier-up event; |
- // - ui::EVENT_REWRITE_REWRITE if this is the last or only modifier-up event; |
- // Otherwise, there is no pending modifier-up event, and this function |
- // returns ui::EVENT_REWRITE_CONTINUE and sets |new_event| to NULL. |
+ int* flags) override; |
ui::EventRewriteStatus NextDispatchEvent( |
- std::unique_ptr<ui::Event>* new_event); |
+ std::unique_ptr<ui::Event>* new_event) override; |
private: |
// Handles keyboard event. Returns true if Sticky key consumes keyboard event. |