| 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 "public/web/WebDOMEvent.h" | 32 #include "public/web/WebDOMEvent.h" |
| 33 | 33 |
| 34 #include "core/EventNames.h" | |
| 35 #include "core/dom/Node.h" | |
| 36 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
| 37 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
| 38 | 36 |
| 39 namespace blink { | 37 namespace blink { |
| 40 | 38 |
| 41 void WebDOMEvent::reset() | 39 void WebDOMEvent::reset() |
| 42 { | 40 { |
| 43 assign(nullptr); | 41 assign(nullptr); |
| 44 } | 42 } |
| 45 | 43 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 56 WebDOMEvent::WebDOMEvent(const PassRefPtrWillBeRawPtr<Event>& event) | 54 WebDOMEvent::WebDOMEvent(const PassRefPtrWillBeRawPtr<Event>& event) |
| 57 : m_private(event) | 55 : m_private(event) |
| 58 { | 56 { |
| 59 } | 57 } |
| 60 | 58 |
| 61 WebDOMEvent::operator PassRefPtrWillBeRawPtr<Event>() const | 59 WebDOMEvent::operator PassRefPtrWillBeRawPtr<Event>() const |
| 62 { | 60 { |
| 63 return m_private.get(); | 61 return m_private.get(); |
| 64 } | 62 } |
| 65 | 63 |
| 66 WebString WebDOMEvent::type() const | |
| 67 { | |
| 68 ASSERT(m_private.get()); | |
| 69 return m_private->type(); | |
| 70 } | |
| 71 | |
| 72 WebNode WebDOMEvent::target() const | |
| 73 { | |
| 74 ASSERT(m_private.get()); | |
| 75 return WebNode(m_private->target()->toNode()); | |
| 76 } | |
| 77 | |
| 78 WebNode WebDOMEvent::currentTarget() const | |
| 79 { | |
| 80 ASSERT(m_private.get()); | |
| 81 return WebNode(m_private->currentTarget()->toNode()); | |
| 82 } | |
| 83 | |
| 84 WebDOMEvent::PhaseType WebDOMEvent::eventPhase() const | |
| 85 { | |
| 86 ASSERT(m_private.get()); | |
| 87 return static_cast<WebDOMEvent::PhaseType>(m_private->eventPhase()); | |
| 88 } | |
| 89 | |
| 90 bool WebDOMEvent::bubbles() const | |
| 91 { | |
| 92 ASSERT(m_private.get()); | |
| 93 return m_private->bubbles(); | |
| 94 } | |
| 95 | |
| 96 bool WebDOMEvent::cancelable() const | |
| 97 { | |
| 98 ASSERT(m_private.get()); | |
| 99 return m_private->cancelable(); | |
| 100 } | |
| 101 | |
| 102 bool WebDOMEvent::isUIEvent() const | |
| 103 { | |
| 104 ASSERT(m_private.get()); | |
| 105 return m_private->isUIEvent(); | |
| 106 } | |
| 107 | |
| 108 bool WebDOMEvent::isMouseEvent() const | |
| 109 { | |
| 110 ASSERT(m_private.get()); | |
| 111 return m_private->isMouseEvent(); | |
| 112 } | |
| 113 | |
| 114 bool WebDOMEvent::isKeyboardEvent() const | |
| 115 { | |
| 116 ASSERT(m_private.get()); | |
| 117 return m_private->isKeyboardEvent(); | |
| 118 } | |
| 119 | |
| 120 bool WebDOMEvent::isMutationEvent() const | |
| 121 { | |
| 122 ASSERT(m_private.get()); | |
| 123 return m_private->hasInterface(EventNames::MutationEvent); | |
| 124 } | |
| 125 | |
| 126 bool WebDOMEvent::isTextEvent() const | |
| 127 { | |
| 128 ASSERT(m_private.get()); | |
| 129 return m_private->hasInterface(EventNames::TextEvent); | |
| 130 } | |
| 131 | |
| 132 bool WebDOMEvent::isCompositionEvent() const | |
| 133 { | |
| 134 ASSERT(m_private.get()); | |
| 135 return m_private->hasInterface(EventNames::CompositionEvent); | |
| 136 } | |
| 137 | |
| 138 bool WebDOMEvent::isDragEvent() const | |
| 139 { | |
| 140 ASSERT(m_private.get()); | |
| 141 return m_private->isDragEvent(); | |
| 142 } | |
| 143 | |
| 144 bool WebDOMEvent::isClipboardEvent() const | |
| 145 { | |
| 146 ASSERT(m_private.get()); | |
| 147 return m_private->isClipboardEvent(); | |
| 148 } | |
| 149 | |
| 150 bool WebDOMEvent::isMessageEvent() const | |
| 151 { | |
| 152 ASSERT(m_private.get()); | |
| 153 return m_private->hasInterface(EventNames::MessageEvent); | |
| 154 } | |
| 155 | |
| 156 bool WebDOMEvent::isWheelEvent() const | |
| 157 { | |
| 158 ASSERT(m_private.get()); | |
| 159 return m_private->hasInterface(EventNames::WheelEvent); | |
| 160 } | |
| 161 | |
| 162 bool WebDOMEvent::isBeforeTextInsertedEvent() const | |
| 163 { | |
| 164 ASSERT(m_private.get()); | |
| 165 return m_private->isBeforeTextInsertedEvent(); | |
| 166 } | |
| 167 | |
| 168 bool WebDOMEvent::isPageTransitionEvent() const | |
| 169 { | |
| 170 ASSERT(m_private.get()); | |
| 171 return m_private->hasInterface(EventNames::PageTransitionEvent); | |
| 172 } | |
| 173 | |
| 174 bool WebDOMEvent::isPopStateEvent() const | |
| 175 { | |
| 176 ASSERT(m_private.get()); | |
| 177 return m_private->hasInterface(EventNames::PopStateEvent); | |
| 178 } | |
| 179 | |
| 180 bool WebDOMEvent::isProgressEvent() const | |
| 181 { | |
| 182 ASSERT(m_private.get()); | |
| 183 return m_private->hasInterface(EventNames::ProgressEvent); | |
| 184 } | |
| 185 | |
| 186 bool WebDOMEvent::isXMLHttpRequestProgressEvent() const | |
| 187 { | |
| 188 ASSERT(m_private.get()); | |
| 189 return m_private->hasInterface(EventNames::XMLHttpRequestProgressEvent); | |
| 190 } | |
| 191 | |
| 192 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |