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

Side by Side Diff: Source/core/events/Event.h

Issue 1233233003: Add Event.isTrusted support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main2
Patch Set: Fix nits Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/events/Event.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 double uiCreateTime() const { return m_uiCreateTime; } 186 double uiCreateTime() const { return m_uiCreateTime; }
187 void setUICreateTime(double uiCreateTime) { m_uiCreateTime = uiCreateTime; } 187 void setUICreateTime(double uiCreateTime) { m_uiCreateTime = uiCreateTime; }
188 188
189 // Events that must not leak across isolated world, similar to how 189 // Events that must not leak across isolated world, similar to how
190 // ErrorEvent behaves, can override this method. 190 // ErrorEvent behaves, can override this method.
191 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; } 191 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return t rue; }
192 192
193 virtual PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator(); 193 virtual PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator();
194 194
195 bool isTrusted() const { return m_isTrusted; }
196 void setTrusted(bool value) { m_isTrusted = value; }
197
195 DECLARE_VIRTUAL_TRACE(); 198 DECLARE_VIRTUAL_TRACE();
196 199
197 protected: 200 protected:
198 Event(); 201 Event();
199 Event(const AtomicString& type, bool canBubble, bool cancelable); 202 Event(const AtomicString& type, bool canBubble, bool cancelable);
200 Event(const AtomicString& type, const EventInit&); 203 Event(const AtomicString& type, const EventInit&);
201 204
202 virtual void receivedTarget(); 205 virtual void receivedTarget();
203 bool dispatched() const { return m_target; } 206 bool dispatched() const { return m_target; }
204 207
205 void setCanBubble(bool bubble) { m_canBubble = bubble; } 208 void setCanBubble(bool bubble) { m_canBubble = bubble; }
206 209
207 private: 210 private:
208 AtomicString m_type; 211 AtomicString m_type;
209 unsigned m_canBubble:1; 212 unsigned m_canBubble:1;
210 unsigned m_cancelable:1; 213 unsigned m_cancelable:1;
211 214
212 unsigned m_propagationStopped:1; 215 unsigned m_propagationStopped:1;
213 unsigned m_immediatePropagationStopped:1; 216 unsigned m_immediatePropagationStopped:1;
214 unsigned m_defaultPrevented:1; 217 unsigned m_defaultPrevented:1;
215 unsigned m_defaultHandled:1; 218 unsigned m_defaultHandled:1;
216 unsigned m_cancelBubble:1; 219 unsigned m_cancelBubble:1;
220 unsigned m_isTrusted : 1;
217 221
218 unsigned short m_eventPhase; 222 unsigned short m_eventPhase;
219 RefPtrWillBeMember<EventTarget> m_currentTarget; 223 RefPtrWillBeMember<EventTarget> m_currentTarget;
220 RefPtrWillBeMember<EventTarget> m_target; 224 RefPtrWillBeMember<EventTarget> m_target;
221 DOMTimeStamp m_createTime; 225 DOMTimeStamp m_createTime;
222 RefPtrWillBeMember<Event> m_underlyingEvent; 226 RefPtrWillBeMember<Event> m_underlyingEvent;
223 OwnPtrWillBeMember<EventPath> m_eventPath; 227 OwnPtrWillBeMember<EventPath> m_eventPath;
224 double m_uiCreateTime; // For input events, the time the event was recorded by the UI. 228 double m_uiCreateTime; // For input events, the time the event was recorded by the UI.
225 }; 229 };
226 230
227 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ 231 #define DEFINE_EVENT_TYPE_CASTS(typeName) \
228 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName()) 232 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t ypeName())
229 233
230 } // namespace blink 234 } // namespace blink
231 235
232 #endif // Event_h 236 #endif // Event_h
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698