| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 | 187 // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/struct
ures5.html#1000000 |
| 188 // Don't take the documentation as truth, however. There are many cases | 188 // Don't take the documentation as truth, however. There are many cases |
| 189 // where mozilla behaves differently than the spec. | 189 // where mozilla behaves differently than the spec. |
| 190 if (event->isMouseEvent()) | 190 if (event->isMouseEvent()) |
| 191 handleMouseEvent(toMouseEvent(event)); | 191 handleMouseEvent(toMouseEvent(event)); |
| 192 else if (event->hasInterface(eventNames().interfaceForWheelEvent)) | 192 else if (event->hasInterface(eventNames().interfaceForWheelEvent)) |
| 193 handleWheelEvent(static_cast<WheelEvent*>(event)); | 193 handleWheelEvent(static_cast<WheelEvent*>(event)); |
| 194 else if (event->isKeyboardEvent()) | 194 else if (event->isKeyboardEvent()) |
| 195 handleKeyboardEvent(toKeyboardEvent(event)); | 195 handleKeyboardEvent(toKeyboardEvent(event)); |
| 196 else if (eventNames().isTouchEventType(event->type())) | 196 else if (eventNames().isTouchEventType(event->type())) |
| 197 handleTouchEvent(static_cast<TouchEvent*>(event)); | 197 handleTouchEvent(toTouchEvent(event)); |
| 198 else if (eventNames().isGestureEventType(event->type())) | 198 else if (eventNames().isGestureEventType(event->type())) |
| 199 handleGestureEvent(static_cast<GestureEvent*>(event)); | 199 handleGestureEvent(static_cast<GestureEvent*>(event)); |
| 200 | 200 |
| 201 // FIXME: it would be cleaner if Widget::handleEvent returned true/false and | 201 // FIXME: it would be cleaner if Widget::handleEvent returned true/false and |
| 202 // HTMLPluginElement called setDefaultHandled or defaultEventHandler. | 202 // HTMLPluginElement called setDefaultHandled or defaultEventHandler. |
| 203 if (!event->defaultHandled()) | 203 if (!event->defaultHandled()) |
| 204 m_element->Node::defaultEventHandler(event); | 204 m_element->Node::defaultEventHandler(event); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void WebPluginContainerImpl::frameRectsChanged() | 207 void WebPluginContainerImpl::frameRectsChanged() |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 if (webEvent.type == WebInputEvent::Undefined) | 849 if (webEvent.type == WebInputEvent::Undefined) |
| 850 return; | 850 return; |
| 851 | 851 |
| 852 WebCursorInfo cursorInfo; | 852 WebCursorInfo cursorInfo; |
| 853 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) | 853 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) |
| 854 event->setDefaultHandled(); | 854 event->setDefaultHandled(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 void WebPluginContainerImpl::focusPlugin() | 857 void WebPluginContainerImpl::focusPlugin() |
| 858 { | 858 { |
| 859 Frame& containingFrame = static_cast<FrameView*>(parent())->frame(); | 859 Frame& containingFrame = toFrameView(parent())->frame(); |
| 860 if (Page* currentPage = containingFrame.page()) | 860 if (Page* currentPage = containingFrame.page()) |
| 861 currentPage->focusController().setFocusedElement(m_element, &containingF
rame); | 861 currentPage->focusController().setFocusedElement(m_element, &containingF
rame); |
| 862 else | 862 else |
| 863 containingFrame.document()->setFocusedElement(m_element); | 863 containingFrame.document()->setFocusedElement(m_element); |
| 864 } | 864 } |
| 865 | 865 |
| 866 void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, | 866 void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, |
| 867 IntRect& windowRect, | 867 IntRect& windowRect, |
| 868 IntRect& clipRect, | 868 IntRect& clipRect, |
| 869 Vector<IntRect>& cutOutRects) | 869 Vector<IntRect>& cutOutRects) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 892 // Take our element and get the clip rect from the enclosing layer and | 892 // Take our element and get the clip rect from the enclosing layer and |
| 893 // frame view. | 893 // frame view. |
| 894 clipRect.intersect( | 894 clipRect.intersect( |
| 895 m_element->document().view()->windowClipRectForFrameOwner(m_element,
true)); | 895 m_element->document().view()->windowClipRectForFrameOwner(m_element,
true)); |
| 896 } | 896 } |
| 897 | 897 |
| 898 return clipRect; | 898 return clipRect; |
| 899 } | 899 } |
| 900 | 900 |
| 901 } // namespace WebKit | 901 } // namespace WebKit |
| OLD | NEW |