OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef HashChangeEvent_h | 21 #ifndef HashChangeEvent_h |
22 #define HashChangeEvent_h | 22 #define HashChangeEvent_h |
23 | 23 |
24 #include "core/events/Event.h" | 24 #include "core/events/Event.h" |
25 | 25 |
26 namespace blink { | 26 namespace blink { |
27 | 27 |
28 struct HashChangeEventInit : public EventInit { | 28 struct HashChangeEventInit : public EventInit { |
29 HashChangeEventInit() | 29 HashChangeEventInit() { } |
30 { | |
31 }; | |
32 | 30 |
33 String oldURL; | 31 String oldURL; |
34 String newURL; | 32 String newURL; |
35 }; | 33 }; |
36 | 34 |
37 class HashChangeEvent FINAL : public Event { | 35 class HashChangeEvent FINAL : public Event { |
38 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
39 public: | 37 public: |
40 static PassRefPtrWillBeRawPtr<HashChangeEvent> create() | 38 static PassRefPtrWillBeRawPtr<HashChangeEvent> create() |
41 { | 39 { |
(...skipping 22 matching lines...) Expand all Loading... |
64 } | 62 } |
65 | 63 |
66 const String& oldURL() const { return m_oldURL; } | 64 const String& oldURL() const { return m_oldURL; } |
67 const String& newURL() const { return m_newURL; } | 65 const String& newURL() const { return m_newURL; } |
68 | 66 |
69 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam
es::HashChangeEvent; } | 67 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam
es::HashChangeEvent; } |
70 | 68 |
71 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); } | 69 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); } |
72 | 70 |
73 private: | 71 private: |
74 HashChangeEvent() | 72 HashChangeEvent() { } |
75 { | |
76 ScriptWrappable::init(this); | |
77 } | |
78 | 73 |
79 HashChangeEvent(const String& oldURL, const String& newURL) | 74 HashChangeEvent(const String& oldURL, const String& newURL) |
80 : Event(EventTypeNames::hashchange, false, false) | 75 : Event(EventTypeNames::hashchange, false, false) |
81 , m_oldURL(oldURL) | 76 , m_oldURL(oldURL) |
82 , m_newURL(newURL) | 77 , m_newURL(newURL) { } |
83 { | |
84 ScriptWrappable::init(this); | |
85 } | |
86 | 78 |
87 HashChangeEvent(const AtomicString& type, const HashChangeEventInit& initial
izer) | 79 HashChangeEvent(const AtomicString& type, const HashChangeEventInit& initial
izer) |
88 : Event(type, initializer) | 80 : Event(type, initializer) |
89 , m_oldURL(initializer.oldURL) | 81 , m_oldURL(initializer.oldURL) |
90 , m_newURL(initializer.newURL) | 82 , m_newURL(initializer.newURL) { } |
91 { | |
92 ScriptWrappable::init(this); | |
93 } | |
94 | 83 |
95 String m_oldURL; | 84 String m_oldURL; |
96 String m_newURL; | 85 String m_newURL; |
97 }; | 86 }; |
98 | 87 |
99 } // namespace blink | 88 } // namespace blink |
100 | 89 |
101 #endif // HashChangeEvent_h | 90 #endif // HashChangeEvent_h |
OLD | NEW |