| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // defaultEventHandler. | 226 // defaultEventHandler. |
| 227 if (!event->defaultHandled()) | 227 if (!event->defaultHandled()) |
| 228 m_element->Node::defaultEventHandler(event); | 228 m_element->Node::defaultEventHandler(event); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void WebPluginContainerImpl::frameRectsChanged() { | 231 void WebPluginContainerImpl::frameRectsChanged() { |
| 232 FrameViewBase::frameRectsChanged(); | 232 FrameViewBase::frameRectsChanged(); |
| 233 reportGeometry(); | 233 reportGeometry(); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void WebPluginContainerImpl::widgetGeometryMayHaveChanged() { | 236 void WebPluginContainerImpl::geometryMayHaveChanged() { |
| 237 FrameViewBase::widgetGeometryMayHaveChanged(); | 237 FrameViewBase::geometryMayHaveChanged(); |
| 238 reportGeometry(); | 238 reportGeometry(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void WebPluginContainerImpl::eventListenersRemoved() { | 241 void WebPluginContainerImpl::eventListenersRemoved() { |
| 242 // We're no longer registered to receive touch events, so don't try to remove | 242 // We're no longer registered to receive touch events, so don't try to remove |
| 243 // the touch event handlers in our destructor. | 243 // the touch event handlers in our destructor. |
| 244 m_touchEventRequestType = TouchEventRequestTypeNone; | 244 m_touchEventRequestType = TouchEventRequestTypeNone; |
| 245 } | 245 } |
| 246 | 246 |
| 247 void WebPluginContainerImpl::setParentVisible(bool parentVisible) { | 247 void WebPluginContainerImpl::setParentVisible(bool parentVisible) { |
| 248 // We override this function to make sure that geometry updates are sent | 248 // We override this function to make sure that geometry updates are sent |
| 249 // over to the plugin. For e.g. when a plugin is instantiated it does not | 249 // over to the plugin. For e.g. when a plugin is instantiated it does not |
| 250 // have a valid parent. As a result the first geometry update from webkit | 250 // have a valid parent. As a result the first geometry update from webkit |
| 251 // is ignored. This function is called when the plugin eventually gets a | 251 // is ignored. This function is called when the plugin eventually gets a |
| 252 // parent. | 252 // parent. |
| 253 | 253 |
| 254 if (isParentVisible() == parentVisible) | 254 if (isParentVisible() == parentVisible) |
| 255 return; // No change. | 255 return; // No change. |
| 256 | 256 |
| 257 FrameViewBase::setParentVisible(parentVisible); | 257 FrameViewBase::setParentVisible(parentVisible); |
| 258 if (!isSelfVisible()) | 258 if (!isSelfVisible()) |
| 259 return; // This widget has explicitely been marked as not visible. | 259 return; // This FrameViewBase has explicitely been marked as not visible. |
| 260 | 260 |
| 261 if (m_webPlugin) | 261 if (m_webPlugin) |
| 262 m_webPlugin->updateVisibility(isVisible()); | 262 m_webPlugin->updateVisibility(isVisible()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) { | 265 void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) { |
| 266 if (plugin == m_webPlugin) | 266 if (plugin == m_webPlugin) |
| 267 return; | 267 return; |
| 268 | 268 |
| 269 m_element->resetInstance(); | 269 m_element->resetInstance(); |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 697 |
| 698 DEFINE_TRACE(WebPluginContainerImpl) { | 698 DEFINE_TRACE(WebPluginContainerImpl) { |
| 699 visitor->trace(m_element); | 699 visitor->trace(m_element); |
| 700 ContextClient::trace(visitor); | 700 ContextClient::trace(visitor); |
| 701 PluginView::trace(visitor); | 701 PluginView::trace(visitor); |
| 702 } | 702 } |
| 703 | 703 |
| 704 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { | 704 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { |
| 705 DCHECK(parent()->isFrameView()); | 705 DCHECK(parent()->isFrameView()); |
| 706 | 706 |
| 707 // We cache the parent FrameView here as the plugin widget could be deleted | 707 // We cache the parent FrameView here as the plugin FrameViewBase could be |
| 708 // in the call to HandleEvent. See http://b/issue?id=1362948 | 708 // deleted in the call to HandleEvent. See http://b/issue?id=1362948 |
| 709 FrameView* parentView = toFrameView(parent()); | 709 FrameView* parentView = toFrameView(parent()); |
| 710 | 710 |
| 711 WebMouseEventBuilder transformedEvent( | 711 WebMouseEventBuilder transformedEvent( |
| 712 this, LayoutItem(m_element->layoutObject()), *event); | 712 this, LayoutItem(m_element->layoutObject()), *event); |
| 713 if (transformedEvent.type() == WebInputEvent::Undefined) | 713 if (transformedEvent.type() == WebInputEvent::Undefined) |
| 714 return; | 714 return; |
| 715 | 715 |
| 716 if (event->type() == EventTypeNames::mousedown) | 716 if (event->type() == EventTypeNames::mousedown) |
| 717 focusPlugin(); | 717 focusPlugin(); |
| 718 | 718 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 // frame view. | 986 // frame view. |
| 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
| 988 } | 988 } |
| 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 990 // Convert to the plugin position. | 990 // Convert to the plugin position. |
| 991 for (size_t i = 0; i < cutOutRects.size(); i++) | 991 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace blink | 995 } // namespace blink |
| OLD | NEW |