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

Unified Diff: third_party/WebKit/Source/core/input/KeyboardEventManager.h

Issue 2290313002: Remove PlatformKeyboardEvent (Closed)
Patch Set: One more fix Created 4 years, 4 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: third_party/WebKit/Source/core/input/KeyboardEventManager.h
diff --git a/third_party/WebKit/Source/core/input/KeyboardEventManager.h b/third_party/WebKit/Source/core/input/KeyboardEventManager.h
index cc1700567a90858a51500238c9a341549b9b82cd..3ee80f33d3b7ff67d3be146b3094c052446059fa 100644
--- a/third_party/WebKit/Source/core/input/KeyboardEventManager.h
+++ b/third_party/WebKit/Source/core/input/KeyboardEventManager.h
@@ -10,6 +10,7 @@
#include "platform/heap/Handle.h"
#include "platform/heap/Visitor.h"
#include "public/platform/WebFocusType.h"
+#include "public/platform/WebInputEvent.h"
#include "public/platform/WebInputEventResult.h"
#include "wtf/Allocator.h"
@@ -17,24 +18,42 @@ namespace blink {
class KeyboardEvent;
class LocalFrame;
-class PlatformKeyboardEvent;
class ScrollManager;
+enum class OverrideCapsLockState {
+ Default,
+ On,
+ Off
+};
+
class CORE_EXPORT KeyboardEventManager {
WTF_MAKE_NONCOPYABLE(KeyboardEventManager);
DISALLOW_NEW();
public:
+ static const int kAccessKeyModifiers =
+// TODO(crbug.com/618397): Add a settings to control this behavior.
+#if OS(MACOSX)
+ WebInputEvent::ControlKey | WebInputEvent::AltKey;
+#else
+ WebInputEvent::AltKey;
+#endif
+
KeyboardEventManager(LocalFrame*, ScrollManager*);
~KeyboardEventManager();
DECLARE_TRACE();
- bool handleAccessKey(const PlatformKeyboardEvent&);
- WebInputEventResult keyEvent(const PlatformKeyboardEvent&);
+ bool handleAccessKey(const WebKeyboardEvent&);
+ WebInputEventResult keyEvent(const WebKeyboardEvent&);
void defaultKeyboardEventHandler(KeyboardEvent*, Node*);
void capsLockStateMayHaveChanged();
+ static WebInputEvent::Modifiers getCurrentModifierState();
+ static bool currentCapsLockState();
private:
+ friend class Internals;
+ // Allows overriding the current caps lock state for testing purposes.
+ static void setCurrentCapsLockState(OverrideCapsLockState);
void defaultSpaceEventHandler(KeyboardEvent*, Node*);
void defaultBackspaceEventHandler(KeyboardEvent*);

Powered by Google App Engine
This is Rietveld 408576698