Index: Source/core/events/RelatedEvent.h |
diff --git a/Source/core/events/RelatedEvent.h b/Source/core/events/RelatedEvent.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..eb99c000b02bfc0574d79902baae2d5fab64fcbb |
--- /dev/null |
+++ b/Source/core/events/RelatedEvent.h |
@@ -0,0 +1,72 @@ |
+/* |
+ * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
+ * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
+ * |
+ * This library is free software; you can redistribute it and/or |
+ * modify it under the terms of the GNU Library General Public |
+ * License as published by the Free Software Foundation; either |
+ * version 2 of the License, or (at your option) any later version. |
+ * |
+ * This library is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+ * Library General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU Library General Public License |
+ * along with this library; see the file COPYING.LIB. If not, write to |
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
+ * Boston, MA 02110-1301, USA. |
+ * |
+ */ |
+ |
+#ifndef RelatedEvent_h |
+#define RelatedEvent_h |
+ |
+#include "core/events/Event.h" |
+ |
+namespace WebCore { |
+ |
+struct RelatedEventInit : public EventInit { |
+ RelatedEventInit(); |
+ RefPtr<EventTarget> relatedTarget; |
+}; |
+ |
+class RelatedEvent : public Event { |
esprehn
2014/05/20 05:51:34
FINAL
pals
2014/05/21 07:55:12
Done.
|
+public: |
+ |
esprehn
2014/05/20 05:51:34
no new line after sections
pals
2014/05/21 07:55:12
Done.
|
+ static PassRefPtr<RelatedEvent> create() |
esprehn
2014/05/20 05:51:34
This method doesn't make sense, what's the type of
pals
2014/05/21 07:55:12
This is needed here
https://code.google.com/p/chro
|
+ { |
+ return adoptRef(new RelatedEvent); |
+ } |
+ |
+ static PassRefPtr<RelatedEvent> create(const AtomicString& eventType); |
+ static PassRefPtr<RelatedEvent> create(const AtomicString& eventType, const RelatedEventInit&); |
+ |
+ virtual ~RelatedEvent(); |
+ |
+ EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
+ EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); } |
+ void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; } |
+ |
+ |
+ virtual const AtomicString& interfaceName() const OVERRIDE; |
+ bool isRelatedEvent() const; |
+ |
+ |
+protected: |
+ |
esprehn
2014/05/20 05:51:34
no new line.
pals
2014/05/21 07:55:12
Done.
|
+ RelatedEvent(); |
+ RelatedEvent(const AtomicString& type); |
+ RelatedEvent(const AtomicString& type, const RelatedEventInit&); |
+ |
+private: |
+ RefPtr<EventTarget> m_relatedTarget; |
+}; |
+ |
+DEFINE_EVENT_TYPE_CASTS(RelatedEvent); |
+ |
+} // namespace WebCore |
+ |
+#endif // RelatedEvent_h |