| 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 } | 655 } |
| 656 | 656 |
| 657 bool WebPluginContainerImpl::wantsWheelEvents() { | 657 bool WebPluginContainerImpl::wantsWheelEvents() { |
| 658 return m_wantsWheelEvents; | 658 return m_wantsWheelEvents; |
| 659 } | 659 } |
| 660 | 660 |
| 661 // Private methods ------------------------------------------------------------- | 661 // Private methods ------------------------------------------------------------- |
| 662 | 662 |
| 663 WebPluginContainerImpl::WebPluginContainerImpl(HTMLPlugInElement* element, | 663 WebPluginContainerImpl::WebPluginContainerImpl(HTMLPlugInElement* element, |
| 664 WebPlugin* webPlugin) | 664 WebPlugin* webPlugin) |
| 665 : DOMWindowProperty(element->document().frame()), | 665 : ContextClient(element->document().frame()), |
| 666 m_element(element), | 666 m_element(element), |
| 667 m_webPlugin(webPlugin), | 667 m_webPlugin(webPlugin), |
| 668 m_webLayer(nullptr), | 668 m_webLayer(nullptr), |
| 669 m_touchEventRequestType(TouchEventRequestTypeNone), | 669 m_touchEventRequestType(TouchEventRequestTypeNone), |
| 670 m_wantsWheelEvents(false), | 670 m_wantsWheelEvents(false), |
| 671 m_isDisposed(false) { | 671 m_isDisposed(false) {} |
| 672 } | |
| 673 | 672 |
| 674 WebPluginContainerImpl::~WebPluginContainerImpl() { | 673 WebPluginContainerImpl::~WebPluginContainerImpl() { |
| 675 // The plugin container must have been disposed of by now. | 674 // The plugin container must have been disposed of by now. |
| 676 DCHECK(!m_webPlugin); | 675 DCHECK(!m_webPlugin); |
| 677 } | 676 } |
| 678 | 677 |
| 679 void WebPluginContainerImpl::dispose() { | 678 void WebPluginContainerImpl::dispose() { |
| 680 m_isDisposed = true; | 679 m_isDisposed = true; |
| 681 | 680 |
| 682 requestTouchEventType(TouchEventRequestTypeNone); | 681 requestTouchEventType(TouchEventRequestTypeNone); |
| 683 setWantsWheelEvents(false); | 682 setWantsWheelEvents(false); |
| 684 | 683 |
| 685 if (m_webPlugin) { | 684 if (m_webPlugin) { |
| 686 CHECK(m_webPlugin->container() == this); | 685 CHECK(m_webPlugin->container() == this); |
| 687 m_webPlugin->destroy(); | 686 m_webPlugin->destroy(); |
| 688 m_webPlugin = nullptr; | 687 m_webPlugin = nullptr; |
| 689 } | 688 } |
| 690 | 689 |
| 691 if (m_webLayer) { | 690 if (m_webLayer) { |
| 692 GraphicsLayer::unregisterContentsLayer(m_webLayer); | 691 GraphicsLayer::unregisterContentsLayer(m_webLayer); |
| 693 m_webLayer = nullptr; | 692 m_webLayer = nullptr; |
| 694 } | 693 } |
| 695 } | 694 } |
| 696 | 695 |
| 697 DEFINE_TRACE(WebPluginContainerImpl) { | 696 DEFINE_TRACE(WebPluginContainerImpl) { |
| 698 visitor->trace(m_element); | 697 visitor->trace(m_element); |
| 699 DOMWindowProperty::trace(visitor); | 698 ContextClient::trace(visitor); |
| 700 PluginView::trace(visitor); | 699 PluginView::trace(visitor); |
| 701 } | 700 } |
| 702 | 701 |
| 703 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { | 702 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { |
| 704 DCHECK(parent()->isFrameView()); | 703 DCHECK(parent()->isFrameView()); |
| 705 | 704 |
| 706 // We cache the parent FrameView here as the plugin widget could be deleted | 705 // We cache the parent FrameView here as the plugin widget could be deleted |
| 707 // in the call to HandleEvent. See http://b/issue?id=1362948 | 706 // in the call to HandleEvent. See http://b/issue?id=1362948 |
| 708 FrameView* parentView = toFrameView(parent()); | 707 FrameView* parentView = toFrameView(parent()); |
| 709 | 708 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 // frame view. | 969 // frame view. |
| 971 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 970 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
| 972 } | 971 } |
| 973 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 972 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 974 // Convert to the plugin position. | 973 // Convert to the plugin position. |
| 975 for (size_t i = 0; i < cutOutRects.size(); i++) | 974 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 976 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 975 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 977 } | 976 } |
| 978 | 977 |
| 979 } // namespace blink | 978 } // namespace blink |
| OLD | NEW |