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

Side by Side Diff: third_party/WebKit/Source/core/events/DragEvent.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/events/DragEvent.h" 5 #include "core/events/DragEvent.h"
6 6
7 #include "core/clipboard/DataTransfer.h" 7 #include "core/clipboard/DataTransfer.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/events/EventDispatcher.h" 9 #include "core/events/EventDispatcher.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 PassRefPtrWillBeRawPtr<DragEvent> DragEvent::create(const AtomicString& type, bo ol canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, 13 RawPtr<DragEvent> DragEvent::create(const AtomicString& type, bool canBubble, bo ol cancelable, RawPtr<AbstractView> view,
14 int detail, int screenX, int screenY, int windowX, int windowY, 14 int detail, int screenX, int screenY, int windowX, int windowY,
15 int movementX, int movementY, 15 int movementX, int movementY,
16 PlatformEvent::Modifiers modifiers, 16 PlatformEvent::Modifiers modifiers,
17 short button, unsigned short buttons, 17 short button, unsigned short buttons,
18 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, 18 RawPtr<EventTarget> relatedTarget,
19 double platformTimeStamp, DataTransfer* dataTransfer, 19 double platformTimeStamp, DataTransfer* dataTransfer,
20 PlatformMouseEvent::SyntheticEventType syntheticEventType) 20 PlatformMouseEvent::SyntheticEventType syntheticEventType)
21 { 21 {
22 return adoptRefWillBeNoop(new DragEvent(type, canBubble, cancelable, view, 22 return new DragEvent(type, canBubble, cancelable, view,
23 detail, screenX, screenY, windowX, windowY, 23 detail, screenX, screenY, windowX, windowY,
24 movementX, movementY, 24 movementX, movementY,
25 modifiers, button, buttons, relatedTarget, platformTimeStamp, 25 modifiers, button, buttons, relatedTarget, platformTimeStamp,
26 dataTransfer, syntheticEventType)); 26 dataTransfer, syntheticEventType);
27 } 27 }
28 28
29 29
30 DragEvent::DragEvent() 30 DragEvent::DragEvent()
31 : m_dataTransfer(nullptr) 31 : m_dataTransfer(nullptr)
32 { 32 {
33 } 33 }
34 34
35 DragEvent::DragEvent(DataTransfer* dataTransfer) 35 DragEvent::DragEvent(DataTransfer* dataTransfer)
36 : m_dataTransfer(dataTransfer) 36 : m_dataTransfer(dataTransfer)
37 { 37 {
38 } 38 }
39 39
40 DragEvent::DragEvent(const AtomicString& eventType, bool canBubble, bool cancela ble, PassRefPtrWillBeRawPtr<AbstractView> view, 40 DragEvent::DragEvent(const AtomicString& eventType, bool canBubble, bool cancela ble, RawPtr<AbstractView> view,
41 int detail, int screenX, int screenY, int windowX, int windowY, 41 int detail, int screenX, int screenY, int windowX, int windowY,
42 int movementX, int movementY, 42 int movementX, int movementY,
43 PlatformEvent::Modifiers modifiers, 43 PlatformEvent::Modifiers modifiers,
44 short button, unsigned short buttons, PassRefPtrWillBeRawPtr<EventTarget> re latedTarget, 44 short button, unsigned short buttons, RawPtr<EventTarget> relatedTarget,
45 double platformTimeStamp, DataTransfer* dataTransfer, 45 double platformTimeStamp, DataTransfer* dataTransfer,
46 PlatformMouseEvent::SyntheticEventType syntheticEventType) 46 PlatformMouseEvent::SyntheticEventType syntheticEventType)
47 : MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screen Y, 47 : MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screen Y,
48 windowX, windowY, movementX, movementY, modifiers, button, buttons, rela tedTarget, 48 windowX, windowY, movementX, movementY, modifiers, button, buttons, rela tedTarget,
49 platformTimeStamp, syntheticEventType, 49 platformTimeStamp, syntheticEventType,
50 // TODO(zino): Should support canvas hit region because the drag event 50 // TODO(zino): Should support canvas hit region because the drag event
51 // is a kind of mouse event. Please see http://crbug.com/594073 51 // is a kind of mouse event. Please see http://crbug.com/594073
52 String()) 52 String())
53 , m_dataTransfer(dataTransfer) 53 , m_dataTransfer(dataTransfer)
54 54
55 { 55 {
56 } 56 }
57 57
58 DragEvent::DragEvent(const AtomicString& type, const DragEventInit& initializer) 58 DragEvent::DragEvent(const AtomicString& type, const DragEventInit& initializer)
59 : MouseEvent(type, initializer) 59 : MouseEvent(type, initializer)
60 , m_dataTransfer(initializer.getDataTransfer()) 60 , m_dataTransfer(initializer.getDataTransfer())
61 { 61 {
62 } 62 }
63 63
64 bool DragEvent::isDragEvent() const 64 bool DragEvent::isDragEvent() const
65 { 65 {
66 return true; 66 return true;
67 } 67 }
68 68
69 bool DragEvent::isMouseEvent() const 69 bool DragEvent::isMouseEvent() const
70 { 70 {
71 return false; 71 return false;
72 } 72 }
73 73
74 PassRefPtrWillBeRawPtr<EventDispatchMediator> DragEvent::createMediator() 74 RawPtr<EventDispatchMediator> DragEvent::createMediator()
75 { 75 {
76 return DragEventDispatchMediator::create(this); 76 return DragEventDispatchMediator::create(this);
77 } 77 }
78 78
79 DEFINE_TRACE(DragEvent) 79 DEFINE_TRACE(DragEvent)
80 { 80 {
81 visitor->trace(m_dataTransfer); 81 visitor->trace(m_dataTransfer);
82 MouseEvent::trace(visitor); 82 MouseEvent::trace(visitor);
83 } 83 }
84 84
85 PassRefPtrWillBeRawPtr<DragEventDispatchMediator> DragEventDispatchMediator::cre ate(PassRefPtrWillBeRawPtr<DragEvent> dragEvent) 85 RawPtr<DragEventDispatchMediator> DragEventDispatchMediator::create(RawPtr<DragE vent> dragEvent)
86 { 86 {
87 return adoptRefWillBeNoop(new DragEventDispatchMediator(dragEvent)); 87 return new DragEventDispatchMediator(dragEvent);
88 } 88 }
89 89
90 DragEventDispatchMediator::DragEventDispatchMediator(PassRefPtrWillBeRawPtr<Drag Event> dragEvent) 90 DragEventDispatchMediator::DragEventDispatchMediator(RawPtr<DragEvent> dragEvent )
91 : EventDispatchMediator(dragEvent) 91 : EventDispatchMediator(dragEvent)
92 { 92 {
93 } 93 }
94 94
95 DragEvent& DragEventDispatchMediator::event() const 95 DragEvent& DragEventDispatchMediator::event() const
96 { 96 {
97 return toDragEvent(EventDispatchMediator::event()); 97 return toDragEvent(EventDispatchMediator::event());
98 } 98 }
99 99
100 DispatchEventResult DragEventDispatchMediator::dispatchEvent(EventDispatcher& di spatcher) const 100 DispatchEventResult DragEventDispatchMediator::dispatchEvent(EventDispatcher& di spatcher) const
101 { 101 {
102 if (event().relatedTargetScoped()) 102 if (event().relatedTargetScoped())
103 event().eventPath().adjustForRelatedTarget(dispatcher.node(), event().re latedTarget()); 103 event().eventPath().adjustForRelatedTarget(dispatcher.node(), event().re latedTarget());
104 return EventDispatchMediator::dispatchEvent(dispatcher); 104 return EventDispatchMediator::dispatchEvent(dispatcher);
105 } 105 }
106 106
107 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/DragEvent.h ('k') | third_party/WebKit/Source/core/events/ErrorEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698