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.
8 #include "core/events/Event.h"
12 struct RelatedEventInit : public EventInit {
14 RefPtrWillBeMember<EventTarget> relatedTarget;
17 class RelatedEvent FINAL : public Event {
19 static PassRefPtrWillBeRawPtr<RelatedEvent> create();
20 static PassRefPtrWillBeRawPtr<RelatedEvent> create(const AtomicString& type, bool canBubble, bool cancelable, EventTarget* relatedTarget);
21 static PassRefPtrWillBeRawPtr<RelatedEvent> create(const AtomicString& eventType, const RelatedEventInit&);
23 virtual ~RelatedEvent();
25 EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
27 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNames::RelatedEvent; }
28 virtual bool isRelatedEvent() const OVERRIDE { return true; }
30 virtual void trace(Visitor*) OVERRIDE;
34 RelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, EventTarget*);
35 RelatedEvent(const AtomicString& type, const RelatedEventInit&);
37 RefPtrWillBeMember<EventTarget> m_relatedTarget;
40 DEFINE_EVENT_TYPE_CASTS(RelatedEvent);
44 #endif // RelatedEvent_h