| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 if (nodes.size() != 1) | 541 if (nodes.size() != 1) |
| 542 return false; | 542 return false; |
| 543 return nodes.first().get() == m_element; | 543 return nodes.first().get() == m_element; |
| 544 } | 544 } |
| 545 | 545 |
| 546 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) | 546 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) |
| 547 { | 547 { |
| 548 if (m_touchEventRequestType == requestType || !m_element) | 548 if (m_touchEventRequestType == requestType || !m_element) |
| 549 return; | 549 return; |
| 550 | 550 |
| 551 if (m_element->document().frameHost()) { | 551 if (FrameHost* frameHost = m_element->document().frameHost()) { |
| 552 EventHandlerRegistry& registry = m_element->document().frameHost()->even
tHandlerRegistry(); | 552 EventHandlerRegistry& registry = frameHost->eventHandlerRegistry(); |
| 553 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType
== TouchEventRequestTypeNone) | 553 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType
== TouchEventRequestTypeNone) |
| 554 registry.didAddEventHandler(*m_element, EventHandlerRegistry::TouchE
ventBlocking); | 554 registry.didAddEventHandler(*m_element, EventHandlerRegistry::TouchE
ventBlocking); |
| 555 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequest
Type != TouchEventRequestTypeNone) | 555 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequest
Type != TouchEventRequestTypeNone) |
| 556 registry.didRemoveEventHandler(*m_element, EventHandlerRegistry::Tou
chEventBlocking); | 556 registry.didRemoveEventHandler(*m_element, EventHandlerRegistry::Tou
chEventBlocking); |
| 557 } | 557 } |
| 558 m_touchEventRequestType = requestType; | 558 m_touchEventRequestType = requestType; |
| 559 } | 559 } |
| 560 | 560 |
| 561 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) | 561 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) |
| 562 { | 562 { |
| 563 if (m_wantsWheelEvents == wantsWheelEvents) | 563 if (m_wantsWheelEvents == wantsWheelEvents) |
| 564 return; | 564 return; |
| 565 if (FrameHost* frameHost = m_element->document().frameHost()) { |
| 566 EventHandlerRegistry& registry = frameHost->eventHandlerRegistry(); |
| 567 if (wantsWheelEvents) |
| 568 registry.didAddEventHandler(*m_element, EventHandlerRegistry::WheelE
ventBlocking); |
| 569 else |
| 570 registry.didRemoveEventHandler(*m_element, EventHandlerRegistry::Whe
elEventBlocking); |
| 571 } |
| 572 |
| 565 m_wantsWheelEvents = wantsWheelEvents; | 573 m_wantsWheelEvents = wantsWheelEvents; |
| 566 if (Page* page = m_element->document().page()) { | 574 if (Page* page = m_element->document().page()) { |
| 567 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) { | 575 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) { |
| 568 if (parent() && parent()->isFrameView()) | 576 if (parent() && parent()->isFrameView()) |
| 569 scrollingCoordinator->notifyGeometryChanged(); | 577 scrollingCoordinator->notifyGeometryChanged(); |
| 570 } | 578 } |
| 571 } | 579 } |
| 572 } | 580 } |
| 573 | 581 |
| 574 WebPoint WebPluginContainerImpl::rootFrameToLocalPoint(const WebPoint& pointInRo
otFrame) | 582 WebPoint WebPluginContainerImpl::rootFrameToLocalPoint(const WebPoint& pointInRo
otFrame) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 #else | 721 #else |
| 714 dispose(); | 722 dispose(); |
| 715 #endif | 723 #endif |
| 716 } | 724 } |
| 717 | 725 |
| 718 void WebPluginContainerImpl::dispose() | 726 void WebPluginContainerImpl::dispose() |
| 719 { | 727 { |
| 720 m_isDisposed = true; | 728 m_isDisposed = true; |
| 721 | 729 |
| 722 requestTouchEventType(TouchEventRequestTypeNone); | 730 requestTouchEventType(TouchEventRequestTypeNone); |
| 731 setWantsWheelEvents(false); |
| 723 | 732 |
| 724 if (m_webPlugin) { | 733 if (m_webPlugin) { |
| 725 RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() ==
this); | 734 RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() ==
this); |
| 726 m_webPlugin->destroy(); | 735 m_webPlugin->destroy(); |
| 727 m_webPlugin = nullptr; | 736 m_webPlugin = nullptr; |
| 728 } | 737 } |
| 729 | 738 |
| 730 if (m_webLayer) { | 739 if (m_webLayer) { |
| 731 GraphicsLayer::unregisterContentsLayer(m_webLayer); | 740 GraphicsLayer::unregisterContentsLayer(m_webLayer); |
| 732 m_webLayer = nullptr; | 741 m_webLayer = nullptr; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 // frame view. | 986 // frame view. |
| 978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); | 987 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); |
| 979 } | 988 } |
| 980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 989 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 981 // Convert to the plugin position. | 990 // Convert to the plugin position. |
| 982 for (size_t i = 0; i < cutOutRects.size(); i++) | 991 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 983 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 992 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 984 } | 993 } |
| 985 | 994 |
| 986 } // namespace blink | 995 } // namespace blink |
| OLD | NEW |