OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 #ifndef CustomEvent_h | 26 #ifndef CustomEvent_h |
27 #define CustomEvent_h | 27 #define CustomEvent_h |
28 | 28 |
29 #include "bindings/v8/ScriptValue.h" | 29 #include "bindings/v8/ScriptValue.h" |
30 #include "bindings/v8/SerializedScriptValue.h" | 30 #include "bindings/v8/SerializedScriptValue.h" |
31 #include "core/dom/Event.h" | 31 #include "core/dom/Event.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 struct CustomEventInit : public EventInit { | 35 struct CustomEventInit : public EventInit { |
adamk
2013/06/22 01:00:04
This can probably just be
typedef EventInit Custo
jww
2013/06/25 01:50:29
Done.
| |
36 CustomEventInit(); | 36 CustomEventInit(); |
37 | |
38 ScriptValue detail; | |
39 }; | 37 }; |
40 | 38 |
41 class CustomEvent : public Event { | 39 class CustomEvent : public Event { |
42 public: | 40 public: |
43 virtual ~CustomEvent(); | 41 virtual ~CustomEvent(); |
44 | 42 |
45 static PassRefPtr<CustomEvent> create() | 43 static PassRefPtr<CustomEvent> create() |
46 { | 44 { |
47 return adoptRef(new CustomEvent); | 45 return adoptRef(new CustomEvent); |
48 } | 46 } |
49 | 47 |
50 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer) | 48 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer) |
51 { | 49 { |
52 return adoptRef(new CustomEvent(type, initializer)); | 50 return adoptRef(new CustomEvent(type, initializer)); |
53 } | 51 } |
54 | 52 |
55 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, const ScriptValue& detail); | 53 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le); |
56 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, PassRefPtr<SerializedScriptValue>); | 54 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, PassRefPtr<SerializedScriptValue>); |
57 | 55 |
58 virtual const AtomicString& interfaceName() const; | 56 virtual const AtomicString& interfaceName() const; |
59 | 57 |
60 const ScriptValue& detail() const { return m_detail; } | |
61 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; } | 58 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; } |
62 | 59 |
63 private: | 60 private: |
64 CustomEvent(); | 61 CustomEvent(); |
65 CustomEvent(const AtomicString& type, const CustomEventInit& initializer); | 62 CustomEvent(const AtomicString& type, const CustomEventInit& initializer); |
66 | 63 |
67 ScriptValue m_detail; | |
68 RefPtr<SerializedScriptValue> m_serializedScriptValue; | 64 RefPtr<SerializedScriptValue> m_serializedScriptValue; |
69 }; | 65 }; |
70 | 66 |
71 } // namespace WebCore | 67 } // namespace WebCore |
72 | 68 |
73 #endif // CustomEvent_h | 69 #endif // CustomEvent_h |
OLD | NEW |