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

Unified Diff: Source/core/events/RelatedEvent.h

Issue 243403006: Implement contextmenu attribute with basic support of <menu> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move to oilpan Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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..ff31cec1c04e2eedd598908ba8bb0ccd851f6519
--- /dev/null
+++ b/Source/core/events/RelatedEvent.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef RelatedEvent_h
+#define RelatedEvent_h
+
+#include "core/events/Event.h"
+
+namespace blink {
+
+struct RelatedEventInit : public EventInit {
+ RelatedEventInit();
+ RefPtrWillBeMember<EventTarget> relatedTarget;
+};
+
+class RelatedEvent FINAL : public Event {
+public:
+ static PassRefPtrWillBeRawPtr<RelatedEvent> create()
+ {
tkent 2014/07/25 04:42:37 The function implementation should be moved to Rel
pals 2014/07/30 09:47:42 Done.
+ return adoptRef(new RelatedEvent);
tkent 2014/07/25 04:42:37 adoptRef -> adoptRefWillBeNoop
pals 2014/07/30 09:47:42 Done.
+ }
+
+ static PassRefPtrWillBeRawPtr<RelatedEvent> create(const AtomicString& eventType);
+ static PassRefPtrWillBeRawPtr<RelatedEvent> create(const AtomicString& eventType, const RelatedEventInit&);
+
+ virtual ~RelatedEvent();
+
+ EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
+ void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
+
+
+ virtual const AtomicString& interfaceName() const OVERRIDE { return EventNames::RelatedEvent; }
+ virtual bool isRelatedEvent() const OVERRIDE { return true; }
+
+protected:
tkent 2014/07/25 04:42:37 This should be private.
pals 2014/07/30 09:47:42 Done.
+ RelatedEvent();
+ explicit RelatedEvent(const AtomicString& type);
+ RelatedEvent(const AtomicString& type, const RelatedEventInit&);
+
+private:
+ RefPtrWillBeMember<EventTarget> m_relatedTarget;
tkent 2014/07/25 04:42:37 Because this class has Member<>, we need to have t
pals 2014/07/30 09:47:42 Done.
+};
+
+DEFINE_EVENT_TYPE_CASTS(RelatedEvent);
+
+} // namespace blink
+
+#endif // RelatedEvent_h

Powered by Google App Engine
This is Rietveld 408576698