| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebDOMEvent.h" | 32 #include "WebDOMEvent.h" |
| 33 | 33 |
| 34 #include "EventNames.h" |
| 34 #include "core/dom/Node.h" | 35 #include "core/dom/Node.h" |
| 35 #include "core/events/Event.h" | 36 #include "core/events/Event.h" |
| 36 #include "core/events/ThreadLocalEventNames.h" | |
| 37 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 38 | 38 |
| 39 using WebCore::eventNames; | |
| 40 | |
| 41 namespace WebKit { | 39 namespace WebKit { |
| 42 | 40 |
| 43 class WebDOMEventPrivate : public WebCore::Event { | 41 class WebDOMEventPrivate : public WebCore::Event { |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 void WebDOMEvent::reset() | 44 void WebDOMEvent::reset() |
| 47 { | 45 { |
| 48 assign(0); | 46 assign(0); |
| 49 } | 47 } |
| 50 | 48 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 116 |
| 119 bool WebDOMEvent::isKeyboardEvent() const | 117 bool WebDOMEvent::isKeyboardEvent() const |
| 120 { | 118 { |
| 121 ASSERT(m_private.get()); | 119 ASSERT(m_private.get()); |
| 122 return m_private->isKeyboardEvent(); | 120 return m_private->isKeyboardEvent(); |
| 123 } | 121 } |
| 124 | 122 |
| 125 bool WebDOMEvent::isMutationEvent() const | 123 bool WebDOMEvent::isMutationEvent() const |
| 126 { | 124 { |
| 127 ASSERT(m_private.get()); | 125 ASSERT(m_private.get()); |
| 128 return m_private->hasInterface(WebCore::eventNames().interfaceForMutationEve
nt); | 126 return m_private->hasInterface(WebCore::EventNames::MutationEvent); |
| 129 } | 127 } |
| 130 | 128 |
| 131 bool WebDOMEvent::isTextEvent() const | 129 bool WebDOMEvent::isTextEvent() const |
| 132 { | 130 { |
| 133 ASSERT(m_private.get()); | 131 ASSERT(m_private.get()); |
| 134 return m_private->hasInterface(eventNames().interfaceForTextEvent); | 132 return m_private->hasInterface(WebCore::EventNames::TextEvent); |
| 135 } | 133 } |
| 136 | 134 |
| 137 bool WebDOMEvent::isCompositionEvent() const | 135 bool WebDOMEvent::isCompositionEvent() const |
| 138 { | 136 { |
| 139 ASSERT(m_private.get()); | 137 ASSERT(m_private.get()); |
| 140 return m_private->hasInterface(eventNames().interfaceForCompositionEvent); | 138 return m_private->hasInterface(WebCore::EventNames::CompositionEvent); |
| 141 } | 139 } |
| 142 | 140 |
| 143 bool WebDOMEvent::isDragEvent() const | 141 bool WebDOMEvent::isDragEvent() const |
| 144 { | 142 { |
| 145 ASSERT(m_private.get()); | 143 ASSERT(m_private.get()); |
| 146 return m_private->isDragEvent(); | 144 return m_private->isDragEvent(); |
| 147 } | 145 } |
| 148 | 146 |
| 149 bool WebDOMEvent::isClipboardEvent() const | 147 bool WebDOMEvent::isClipboardEvent() const |
| 150 { | 148 { |
| 151 ASSERT(m_private.get()); | 149 ASSERT(m_private.get()); |
| 152 return m_private->isClipboardEvent(); | 150 return m_private->isClipboardEvent(); |
| 153 } | 151 } |
| 154 | 152 |
| 155 bool WebDOMEvent::isMessageEvent() const | 153 bool WebDOMEvent::isMessageEvent() const |
| 156 { | 154 { |
| 157 ASSERT(m_private.get()); | 155 ASSERT(m_private.get()); |
| 158 return m_private->hasInterface(eventNames().interfaceForMessageEvent); | 156 return m_private->hasInterface(WebCore::EventNames::MessageEvent); |
| 159 } | 157 } |
| 160 | 158 |
| 161 bool WebDOMEvent::isWheelEvent() const | 159 bool WebDOMEvent::isWheelEvent() const |
| 162 { | 160 { |
| 163 ASSERT(m_private.get()); | 161 ASSERT(m_private.get()); |
| 164 return m_private->hasInterface(eventNames().interfaceForWheelEvent); | 162 return m_private->hasInterface(WebCore::EventNames::WheelEvent); |
| 165 } | 163 } |
| 166 | 164 |
| 167 bool WebDOMEvent::isBeforeTextInsertedEvent() const | 165 bool WebDOMEvent::isBeforeTextInsertedEvent() const |
| 168 { | 166 { |
| 169 ASSERT(m_private.get()); | 167 ASSERT(m_private.get()); |
| 170 return m_private->isBeforeTextInsertedEvent(); | 168 return m_private->isBeforeTextInsertedEvent(); |
| 171 } | 169 } |
| 172 | 170 |
| 173 bool WebDOMEvent::isOverflowEvent() const | 171 bool WebDOMEvent::isOverflowEvent() const |
| 174 { | 172 { |
| 175 ASSERT(m_private.get()); | 173 ASSERT(m_private.get()); |
| 176 return m_private->hasInterface(eventNames().interfaceForOverflowEvent); | 174 return m_private->hasInterface(WebCore::EventNames::OverflowEvent); |
| 177 } | 175 } |
| 178 | 176 |
| 179 bool WebDOMEvent::isPageTransitionEvent() const | 177 bool WebDOMEvent::isPageTransitionEvent() const |
| 180 { | 178 { |
| 181 ASSERT(m_private.get()); | 179 ASSERT(m_private.get()); |
| 182 return m_private->hasInterface(eventNames().interfaceForPageTransitionEvent)
; | 180 return m_private->hasInterface(WebCore::EventNames::PageTransitionEvent); |
| 183 } | 181 } |
| 184 | 182 |
| 185 bool WebDOMEvent::isPopStateEvent() const | 183 bool WebDOMEvent::isPopStateEvent() const |
| 186 { | 184 { |
| 187 ASSERT(m_private.get()); | 185 ASSERT(m_private.get()); |
| 188 return m_private->hasInterface(eventNames().interfaceForPopStateEvent); | 186 return m_private->hasInterface(WebCore::EventNames::PopStateEvent); |
| 189 } | 187 } |
| 190 | 188 |
| 191 bool WebDOMEvent::isProgressEvent() const | 189 bool WebDOMEvent::isProgressEvent() const |
| 192 { | 190 { |
| 193 ASSERT(m_private.get()); | 191 ASSERT(m_private.get()); |
| 194 return m_private->hasInterface(eventNames().interfaceForProgressEvent); | 192 return m_private->hasInterface(WebCore::EventNames::ProgressEvent); |
| 195 } | 193 } |
| 196 | 194 |
| 197 bool WebDOMEvent::isXMLHttpRequestProgressEvent() const | 195 bool WebDOMEvent::isXMLHttpRequestProgressEvent() const |
| 198 { | 196 { |
| 199 ASSERT(m_private.get()); | 197 ASSERT(m_private.get()); |
| 200 return m_private->hasInterface(eventNames().interfaceForXMLHttpRequestProgre
ssEvent); | 198 return m_private->hasInterface(WebCore::EventNames::XMLHttpRequestProgressEv
ent); |
| 201 } | 199 } |
| 202 | 200 |
| 203 bool WebDOMEvent::isBeforeLoadEvent() const | 201 bool WebDOMEvent::isBeforeLoadEvent() const |
| 204 { | 202 { |
| 205 ASSERT(m_private.get()); | 203 ASSERT(m_private.get()); |
| 206 return m_private->hasInterface(eventNames().interfaceForBeforeLoadEvent); | 204 return m_private->hasInterface(WebCore::EventNames::BeforeLoadEvent); |
| 207 } | 205 } |
| 208 | 206 |
| 209 } // namespace WebKit | 207 } // namespace WebKit |
| OLD | NEW |