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

Unified Diff: ash/sticky_keys/sticky_keys_controller.h

Issue 137373003: Show overlay displaying the state of all sticky keys when it is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: 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 c31eebd70a8e1ca428a959d885305fb9cc4329e0..30b0d3d1b1f2120cbeea0ed68d76e630faae2d09 100644
--- a/ash/sticky_keys/sticky_keys_controller.h
+++ b/ash/sticky_keys/sticky_keys_controller.h
@@ -6,6 +6,7 @@
#define ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_
#include "ash/ash_export.h"
+#include "ash/sticky_keys/sticky_keys_constants.h"
#include "base/memory/scoped_ptr.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
@@ -22,6 +23,7 @@ class Window;
namespace ash {
+class StickyKeysOverlay;
class StickyKeysHandler;
// StickyKeysController is an accessibility feature for users to be able to
@@ -80,6 +82,9 @@ class ASH_EXPORT StickyKeysController : public ui::EventHandler {
virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
+ // Updates the overlay UI with the current state of the sticky keys.
+ void UpdateOverlay();
+
// Whether sticky keys is activated and modifying events.
bool enabled_;
@@ -88,6 +93,8 @@ class ASH_EXPORT StickyKeysController : public ui::EventHandler {
scoped_ptr<StickyKeysHandler> alt_sticky_key_;
scoped_ptr<StickyKeysHandler> ctrl_sticky_key_;
+ scoped_ptr<StickyKeysOverlay> overlay_;
+
DISALLOW_COPY_AND_ASSIGN(StickyKeysController);
};
@@ -139,22 +146,9 @@ class ASH_EXPORT StickyKeysHandler {
virtual void DispatchScrollEvent(ui::ScrollEvent* event,
aura::Window* target) = 0;
};
- // Represents Sticky Key state.
- enum StickyKeyState {
- // The sticky key is disabled. Incomming non modifier key events are not
- // affected.
- DISABLED,
- // The sticky key is enabled. Incomming non modifier key down events are
- // modified with |modifier_flag_|. After that, sticky key state become
- // DISABLED.
- ENABLED,
- // The sticky key is locked. Incomming non modifier key down events are
- // modified with |modifier_flag_|.
- LOCKED,
- };
// This class takes an ownership of |delegate|.
- StickyKeysHandler(ui::EventFlags modifier_flag,
+ StickyKeysHandler(StickyKeyModifier modifier,
StickyKeysHandlerDelegate* delegate);
~StickyKeysHandler();
@@ -207,7 +201,10 @@ class ASH_EXPORT StickyKeysHandler {
void AppendModifier(ui::MouseEvent* event);
void AppendModifier(ui::ScrollEvent* event);
- // The modifier flag to be monitored and appended.
+ // The modifier key this handler is responsible for.
+ StickyKeyModifier modifier_;
+
+ // The modifier flag to be monitored and appended to events.
const ui::EventFlags modifier_flag_;
// The current sticky key status.

Powered by Google App Engine
This is Rietveld 408576698