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

Unified Diff: Source/core/events/DragEvent.h

Issue 1232003009: Implement DragEvent and move MouseEvent.dataTransfer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix plugin failure of LayoutTest Created 5 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/events/DragEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/DragEvent.h
diff --git a/Source/core/events/DragEvent.h b/Source/core/events/DragEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..f4f7ea81dcacc353ec61ac40b0d45c0971127365
--- /dev/null
+++ b/Source/core/events/DragEvent.h
@@ -0,0 +1,80 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DragEvent_h
+#define DragEvent_h
+
+#include "core/events/DragEventInit.h"
+#include "core/events/MouseEvent.h"
+
+namespace blink {
+
+class DataTransfer;
+
+class DragEvent final : public MouseEvent {
+ DEFINE_WRAPPERTYPEINFO();
+
+public:
+ static PassRefPtrWillBeRawPtr<DragEvent> create()
+ {
+ return adoptRefWillBeNoop(new DragEvent);
+ }
+
+ static PassRefPtrWillBeRawPtr<DragEvent> create(DataTransfer* dataTransfer)
+ {
+ return adoptRefWillBeNoop(new DragEvent(dataTransfer));
+ }
+
+ static PassRefPtrWillBeRawPtr<DragEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>,
+ int detail, int screenX, int screenY, int windowX, int windowY,
+ int movementX, int movementY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, unsigned short buttons,
+ PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*,
+ bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = PlatformMouseEvent::RealOrIndistinguishable,
+ double uiCreateTime = 0);
+
+ static PassRefPtrWillBeRawPtr<DragEvent> create(const AtomicString& type, const DragEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new DragEvent(type, initializer));
+ }
+
+ DataTransfer* dataTransfer() const override { return isDragEvent() ? m_dataTransfer.get() : 0; }
+
+ bool isDragEvent() const override;
+ bool isMouseEvent() const override;
+
+ PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ DragEvent();
+ DragEvent(DataTransfer*);
+ DragEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>,
+ int detail, int screenX, int screenY, int windowX, int windowY,
+ int movementX, int movementY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, unsigned short buttons,
+ PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*,
+ bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreateTime = 0);
+
+ DragEvent(const AtomicString& type, const DragEventInit&);
+
+ PersistentWillBeMember<DataTransfer> m_dataTransfer;
+};
+
+class DragEventDispatchMediator final : public EventDispatchMediator {
+public:
+ static PassRefPtrWillBeRawPtr<DragEventDispatchMediator> create(PassRefPtrWillBeRawPtr<DragEvent>);
+
+private:
+ explicit DragEventDispatchMediator(PassRefPtrWillBeRawPtr<DragEvent>);
+ DragEvent& event() const;
+ bool dispatchEvent(EventDispatcher&) const override;
+};
+
+DEFINE_EVENT_TYPE_CASTS(DragEvent);
+
+} // namespace blink
+
+#endif // DragEvent_h
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/events/DragEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698