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

Side by Side Diff: third_party/WebKit/Source/core/events/EventTarget.h

Issue 1922093003: Add AddEventListenerOptions addEventListenerOptions interface. (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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 virtual const AtomicString& interfaceName() const = 0; 107 virtual const AtomicString& interfaceName() const = 0;
108 virtual ExecutionContext* getExecutionContext() const = 0; 108 virtual ExecutionContext* getExecutionContext() const = 0;
109 109
110 virtual Node* toNode(); 110 virtual Node* toNode();
111 virtual const DOMWindow* toDOMWindow() const; 111 virtual const DOMWindow* toDOMWindow() const;
112 virtual const LocalDOMWindow* toLocalDOMWindow() const; 112 virtual const LocalDOMWindow* toLocalDOMWindow() const;
113 virtual LocalDOMWindow* toLocalDOMWindow(); 113 virtual LocalDOMWindow* toLocalDOMWindow();
114 virtual MessagePort* toMessagePort(); 114 virtual MessagePort* toMessagePort();
115 115
116 bool addEventListener(const AtomicString& eventType, EventListener*, bool us eCapture = false); 116 bool addEventListener(const AtomicString& eventType, EventListener*, bool us eCapture = false);
117 bool addEventListener(const AtomicString& eventType, EventListener*, const E ventListenerOptionsOrBoolean&); 117 bool addEventListener(const AtomicString& eventType, EventListener*, const A ddEventListenerOptionsOrBoolean&);
118 bool addEventListener(const AtomicString& eventType, EventListener*, EventLi stenerOptions&); 118 bool addEventListener(const AtomicString& eventType, EventListener*, AddEven tListenerOptions&);
119 119
120 bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture = false); 120 bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture = false);
121 bool removeEventListener(const AtomicString& eventType, EventListener*, cons t EventListenerOptionsOrBoolean&); 121 bool removeEventListener(const AtomicString& eventType, EventListener*, cons t EventListenerOptionsOrBoolean&);
122 bool removeEventListener(const AtomicString& eventType, EventListener*, Even tListenerOptions&); 122 bool removeEventListener(const AtomicString& eventType, EventListener*, Even tListenerOptions&);
123 virtual void removeAllEventListeners(); 123 virtual void removeAllEventListeners();
124 124
125 DispatchEventResult dispatchEvent(Event*); 125 DispatchEventResult dispatchEvent(Event*);
126 126
127 // dispatchEventForBindings is intended to only be called from 127 // dispatchEventForBindings is intended to only be called from
128 // javascript originated calls. This method will validate and may adjust 128 // javascript originated calls. This method will validate and may adjust
(...skipping 15 matching lines...) Expand all
144 144
145 static DispatchEventResult dispatchEventResult(const Event&); 145 static DispatchEventResult dispatchEventResult(const Event&);
146 146
147 DEFINE_INLINE_VIRTUAL_TRACE() { } 147 DEFINE_INLINE_VIRTUAL_TRACE() { }
148 148
149 virtual bool keepEventInNode(Event*) { return false; } 149 virtual bool keepEventInNode(Event*) { return false; }
150 150
151 protected: 151 protected:
152 EventTarget(); 152 EventTarget();
153 153
154 virtual bool addEventListenerInternal(const AtomicString& eventType, EventLi stener*, const EventListenerOptions&); 154 virtual bool addEventListenerInternal(const AtomicString& eventType, EventLi stener*, const AddEventListenerOptions&);
155 virtual bool removeEventListenerInternal(const AtomicString& eventType, Even tListener*, const EventListenerOptions&); 155 virtual bool removeEventListenerInternal(const AtomicString& eventType, Even tListener*, const EventListenerOptions&);
156 virtual void removedEventListener(const AtomicString& eventType, const Regis teredEventListener&);
156 virtual DispatchEventResult dispatchEventInternal(Event*); 157 virtual DispatchEventResult dispatchEventInternal(Event*);
157 158
158 // Subclasses should likely not override these themselves; instead, they sho uld subclass EventTargetWithInlineData. 159 // Subclasses should likely not override these themselves; instead, they sho uld subclass EventTargetWithInlineData.
159 virtual EventTargetData* eventTargetData() = 0; 160 virtual EventTargetData* eventTargetData() = 0;
160 virtual EventTargetData& ensureEventTargetData() = 0; 161 virtual EventTargetData& ensureEventTargetData() = 0;
161 162
162 private: 163 private:
163 LocalDOMWindow* executingWindow(); 164 LocalDOMWindow* executingWindow();
164 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); 165 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&);
165 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect or*, EventListenerVector*); 166 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect or*, EventListenerVector*);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 { 244 {
244 EventTargetData* d = eventTargetData(); 245 EventTargetData* d = eventTargetData();
245 if (!d) 246 if (!d)
246 return false; 247 return false;
247 return d->eventListenerMap.containsCapturing(eventType); 248 return d->eventListenerMap.containsCapturing(eventType);
248 } 249 }
249 250
250 } // namespace blink 251 } // namespace blink
251 252
252 #endif // EventTarget_h 253 #endif // EventTarget_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698