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

Unified Diff: third_party/WebKit/Source/core/events/MouseEvent.h

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: 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/Source/core/events/MouseEvent.h
diff --git a/third_party/WebKit/Source/core/events/MouseEvent.h b/third_party/WebKit/Source/core/events/MouseEvent.h
index 767a3409f788b7365c57298d82b11f583eee7241..1ec52e7797cd1dc3800f06bb88a3321908ac7578 100644
--- a/third_party/WebKit/Source/core/events/MouseEvent.h
+++ b/third_party/WebKit/Source/core/events/MouseEvent.h
@@ -28,7 +28,6 @@
#include "core/events/EventDispatchMediator.h"
#include "core/events/MouseEventInit.h"
#include "core/events/UIEventWithKeyState.h"
-#include "platform/PlatformMouseEvent.h"
#include "public/platform/WebMouseEvent.h"
namespace blink {
@@ -39,34 +38,24 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
DEFINE_WRAPPERTYPEINFO();
public:
- static MouseEvent* create() { return new MouseEvent; }
+ enum SyntheticEventType {
+ // Real mouse input events or synthetic events that behave just like real
+ // events
+ RealOrIndistinguishable,
+ // Synthetic mouse events derived from touch input
+ FromTouch,
+ // Synthetic mouse events generated without a position, for example those
+ // generated from keyboard input.
+ Positionless,
+ };
- // TODO(mustaq): Should replace most/all of these params with a
- // MouseEventInit.
- static MouseEvent* create(const AtomicString& type,
- bool canBubble,
- bool cancelable,
- AbstractView*,
- int detail,
- int screenX,
- int screenY,
- int windowX,
- int windowY,
- int movementX,
- int movementY,
- PlatformEvent::Modifiers,
- short button,
- unsigned short buttons,
- EventTarget* relatedTarget,
- TimeTicks platformTimeStamp,
- PlatformMouseEvent::SyntheticEventType,
- const String& region,
- const PlatformMouseEvent*);
+ static MouseEvent* create() { return new MouseEvent; }
static MouseEvent* create(const AtomicString& eventType,
AbstractView*,
- const PlatformMouseEvent&,
+ const WebMouseEvent&,
int detail,
+ const String& canvasRegionId,
Node* relatedTarget);
static MouseEvent* create(ScriptState*,
@@ -109,7 +98,7 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
void setRelatedTarget(EventTarget* relatedTarget) {
m_relatedTarget = relatedTarget;
}
- PlatformMouseEvent::SyntheticEventType getSyntheticEventType() const {
+ SyntheticEventType getSyntheticEventType() const {
return m_syntheticEventType;
}
const String& region() const { return m_region; }
@@ -120,9 +109,7 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
virtual DataTransfer* getDataTransfer() const { return nullptr; }
- bool fromTouch() const {
- return m_syntheticEventType == PlatformMouseEvent::FromTouch;
- }
+ bool fromTouch() const { return m_syntheticEventType == FromTouch; }
const AtomicString& interfaceName() const override;
@@ -133,7 +120,7 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
int clickCount() { return detail(); }
- const PlatformMouseEvent* mouseEvent() const { return m_mouseEvent.get(); }
+ const WebMouseEvent* nativeEvent() const { return m_nativeEvent.get(); }
enum class PositionType {
Position,
@@ -200,9 +187,10 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
bool canBubble,
bool cancelable,
AbstractView*,
- PlatformMouseEvent::SyntheticEventType,
+ const WebMouseEvent&,
+ int detail,
const String& region,
- const WebMouseEvent&);
+ EventTarget* relatedTarget);
MouseEvent(const AtomicString& type,
bool canBubble,
@@ -220,9 +208,8 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
unsigned short buttons,
EventTarget* relatedTarget,
TimeTicks platformTimeStamp,
- PlatformMouseEvent::SyntheticEventType,
- const String& region,
- const PlatformMouseEvent*);
+ SyntheticEventType,
+ const String& region);
MouseEvent(const AtomicString& type, const MouseEventInit&);
@@ -267,9 +254,9 @@ class CORE_EXPORT MouseEvent : public UIEventWithKeyState {
short m_button;
unsigned short m_buttons;
Member<EventTarget> m_relatedTarget;
- PlatformMouseEvent::SyntheticEventType m_syntheticEventType;
+ SyntheticEventType m_syntheticEventType;
String m_region;
- std::unique_ptr<PlatformMouseEvent> m_mouseEvent;
+ std::unique_ptr<WebMouseEvent> m_nativeEvent;
};
class MouseEventDispatchMediator final : public EventDispatchMediator {

Powered by Google App Engine
This is Rietveld 408576698