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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/events/DragEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DragEvent_h
6 #define DragEvent_h
7
8 #include "core/events/DragEventInit.h"
9 #include "core/events/MouseEvent.h"
10
11 namespace blink {
12
13 class DataTransfer;
14
15 class DragEvent final : public MouseEvent {
16 DEFINE_WRAPPERTYPEINFO();
17
18 public:
19 static PassRefPtrWillBeRawPtr<DragEvent> create()
20 {
21 return adoptRefWillBeNoop(new DragEvent);
22 }
23
24 static PassRefPtrWillBeRawPtr<DragEvent> create(DataTransfer* dataTransfer)
25 {
26 return adoptRefWillBeNoop(new DragEvent(dataTransfer));
27 }
28
29 static PassRefPtrWillBeRawPtr<DragEvent> create(const AtomicString& type, bo ol canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>,
30 int detail, int screenX, int screenY, int windowX, int windowY,
31 int movementX, int movementY,
32 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un signed short buttons,
33 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*,
34 bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = Platf ormMouseEvent::RealOrIndistinguishable,
35 double uiCreateTime = 0);
36
37 static PassRefPtrWillBeRawPtr<DragEvent> create(const AtomicString& type, co nst DragEventInit& initializer)
38 {
39 return adoptRefWillBeNoop(new DragEvent(type, initializer));
40 }
41
42 DataTransfer* dataTransfer() const override { return isDragEvent() ? m_dataT ransfer.get() : 0; }
43
44 bool isDragEvent() const override;
45 bool isMouseEvent() const override;
46
47 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override;
48
49 DECLARE_VIRTUAL_TRACE();
50
51 private:
52 DragEvent();
53 DragEvent(DataTransfer*);
54 DragEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRef PtrWillBeRawPtr<AbstractView>,
55 int detail, int screenX, int screenY, int windowX, int windowY,
56 int movementX, int movementY,
57 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un signed short buttons,
58 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*,
59 bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreat eTime = 0);
60
61 DragEvent(const AtomicString& type, const DragEventInit&);
62
63 PersistentWillBeMember<DataTransfer> m_dataTransfer;
64 };
65
66 class DragEventDispatchMediator final : public EventDispatchMediator {
67 public:
68 static PassRefPtrWillBeRawPtr<DragEventDispatchMediator> create(PassRefPtrWi llBeRawPtr<DragEvent>);
69
70 private:
71 explicit DragEventDispatchMediator(PassRefPtrWillBeRawPtr<DragEvent>);
72 DragEvent& event() const;
73 bool dispatchEvent(EventDispatcher&) const override;
74 };
75
76 DEFINE_EVENT_TYPE_CASTS(DragEvent);
77
78 } // namespace blink
79
80 #endif // DragEvent_h
OLDNEW
« 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