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

Unified Diff: third_party/WebKit/public/platform/WebInputEvent.h

Issue 2639273002: Give WebTouchEvent and WebKeyboardEvent their own headers (Closed)
Patch Set: Rebase Created 3 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: third_party/WebKit/public/platform/WebInputEvent.h
diff --git a/third_party/WebKit/public/platform/WebInputEvent.h b/third_party/WebKit/public/platform/WebInputEvent.h
index 649dee401076b71929cb7b76fbcbf678def460ee..99e27f0810b4b9658680d37301fec4a7d3d6d8b9 100644
--- a/third_party/WebKit/public/platform/WebInputEvent.h
+++ b/third_party/WebKit/public/platform/WebInputEvent.h
@@ -334,119 +334,6 @@ class WebInputEvent {
int m_modifiers;
};
-// WebKeyboardEvent -----------------------------------------------------------
-
-class WebKeyboardEvent : public WebInputEvent {
- public:
- // Caps on string lengths so we can make them static arrays and keep
- // them PODs.
- static const size_t textLengthCap = 4;
-
- // |windowsKeyCode| is the Windows key code associated with this key
- // event. Sometimes it's direct from the event (i.e. on Windows),
- // sometimes it's via a mapping function. If you want a list, see
- // WebCore/platform/chromium/KeyboardCodes* . Note that this should
- // ALWAYS store the non-locational version of a keycode as this is
- // what is returned by the Windows API. For example, it should
- // store VK_SHIFT instead of VK_RSHIFT. The location information
- // should be stored in |modifiers|.
- int windowsKeyCode;
-
- // The actual key code genenerated by the platform. The DOM spec runs
- // on Windows-equivalent codes (thus |windowsKeyCode| above) but it
- // doesn't hurt to have this one around.
- int nativeKeyCode;
-
- // The DOM code enum of the key pressed as passed by the embedder. DOM
- // code enum are defined in ui/events/keycodes/dom4/keycode_converter_data.h.
- int domCode;
-
- // The DOM key enum of the key pressed as passed by the embedder. DOM
- // key enum are defined in ui/events/keycodes/dom3/dom_key_data.h
- int domKey;
-
- // This identifies whether this event was tagged by the system as being
- // a "system key" event (see
- // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for
- // details). Other platforms don't have this concept, but it's just
- // easier to leave it always false than ifdef.
- bool isSystemKey;
-
- // Whether the event forms part of a browser-handled keyboard shortcut.
- // This can be used to conditionally suppress Char events after a
- // shortcut-triggering RawKeyDown goes unhandled.
- bool isBrowserShortcut;
-
- // |text| is the text generated by this keystroke. |unmodifiedText| is
- // |text|, but unmodified by an concurrently-held modifiers (except
- // shift). This is useful for working out shortcut keys. Linux and
- // Windows guarantee one character per event. The Mac does not, but in
- // reality that's all it ever gives. We're generous, and cap it a bit
- // longer.
- WebUChar text[textLengthCap];
- WebUChar unmodifiedText[textLengthCap];
-
- WebKeyboardEvent(Type type, int modifiers, double timeStampSeconds)
- : WebInputEvent(sizeof(WebKeyboardEvent),
- type,
- modifiers,
- timeStampSeconds) {}
-
- WebKeyboardEvent() : WebInputEvent(sizeof(WebKeyboardEvent)) {}
-
- // Please refer to bug http://b/issue?id=961192, which talks about Webkit
- // keyboard event handling changes. It also mentions the list of keys
- // which don't have associated character events.
- bool isCharacterKey() const {
- // TODO(dtapuska): Determine if we can remove this method and just
- // not actually generate events for these instead of filtering them out.
- switch (windowsKeyCode) {
- case 0x08: // VK_BACK
- case 0x1b: // VK_ESCAPE
- return false;
- }
- return true;
- }
-};
-
-// WebTouchEvent --------------------------------------------------------------
-
-// TODO(e_hakkinen): Replace with WebPointerEvent. crbug.com/508283
-class WebTouchEvent : public WebInputEvent {
- public:
- // Maximum number of simultaneous touches supported on
- // Ash/Aura.
- enum { kTouchesLengthCap = 16 };
-
- unsigned touchesLength;
- // List of all touches, regardless of state.
- WebTouchPoint touches[kTouchesLengthCap];
-
- // Whether the event is blocking, non-blocking, all event
- // listeners were passive or was forced to be non-blocking.
- DispatchType dispatchType;
-
- // For a single touch, this is true after the touch-point has moved beyond
- // the platform slop region. For a multitouch, this is true after any
- // touch-point has moved (by whatever amount).
- bool movedBeyondSlopRegion;
-
- // Whether this touch event is a touchstart or a first touchmove event per
- // scroll.
- bool touchStartOrFirstTouchMove;
-
- // A unique identifier for the touch event. Valid ids start at one and
- // increase monotonically. Zero means an unknown id.
- uint32_t uniqueTouchEventId;
-
- WebTouchEvent()
- : WebInputEvent(sizeof(WebTouchEvent)), dispatchType(Blocking) {}
-
- WebTouchEvent(Type type, int modifiers, double timeStampSeconds)
- : WebInputEvent(sizeof(WebTouchEvent), type, modifiers, timeStampSeconds),
- dispatchType(Blocking) {}
-};
-
#pragma pack(pop)
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebViewTest.cpp ('k') | third_party/WebKit/public/platform/WebKeyboardEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698