OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 RelatedEvent_h | |
6 #define RelatedEvent_h | |
7 | |
8 #include "core/events/Event.h" | |
9 | |
10 namespace WebCore { | |
11 | |
12 struct RelatedEventInit : public EventInit { | |
13 RelatedEventInit(); | |
14 RefPtr<EventTarget> relatedTarget; | |
15 }; | |
16 | |
17 class RelatedEvent FINAL : public Event { | |
18 public: | |
19 static PassRefPtr<RelatedEvent> create() | |
20 { | |
21 return adoptRef(new RelatedEvent); | |
22 } | |
23 | |
24 static PassRefPtr<RelatedEvent> create(const AtomicString& eventType); | |
25 static PassRefPtr<RelatedEvent> create(const AtomicString& eventType, const RelatedEventInit&); | |
26 | |
27 virtual ~RelatedEvent() { } | |
28 | |
29 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | |
30 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); } | |
esprehn
2014/06/06 22:30:42
I don't know what this method is, but you definite
pals
2014/06/10 10:42:39
It is being called by generated files
gen/blink/bi
| |
31 void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarg et = relatedTarget; } | |
32 | |
33 | |
34 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam es::RelatedEvent; } | |
35 bool isRelatedEvent() const { return true; } | |
esprehn
2014/06/06 22:30:41
Shouldn't this be virtual?
pals
2014/06/10 10:42:39
Done.
| |
36 | |
37 protected: | |
38 RelatedEvent(); | |
39 RelatedEvent(const AtomicString& type); | |
40 RelatedEvent(const AtomicString& type, const RelatedEventInit&); | |
41 | |
42 private: | |
43 RefPtr<EventTarget> m_relatedTarget; | |
44 }; | |
45 | |
46 DEFINE_EVENT_TYPE_CASTS(RelatedEvent); | |
47 | |
48 } // namespace WebCore | |
49 | |
50 #endif // RelatedEvent_h | |
OLD | NEW |