Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1828203003: Flash players weren't receiving mouse wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 if (m_element && m_wantsWheelEvents) {
732 if (FrameHost* frameHost = m_element->document().frameHost())
733 frameHost->eventHandlerRegistry().didRemoveEventHandler(*m_element, EventHandlerRegistry::WheelEventBlocking);
aelias_OOO_until_Jul13 2016/03/24 19:15:05 Can we call "setWantsWheelEvents(false);" to avoid
dtapuska 2016/03/24 21:14:29 I wanted to avoid the updateGeometry call inside t
aelias_OOO_until_Jul13 2016/03/25 00:05:40 Why did you want that, is there a reason to think
734 }
723 735
724 if (m_webPlugin) { 736 if (m_webPlugin) {
725 RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this); 737 RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this);
726 m_webPlugin->destroy(); 738 m_webPlugin->destroy();
727 m_webPlugin = nullptr; 739 m_webPlugin = nullptr;
728 } 740 }
729 741
730 if (m_webLayer) { 742 if (m_webLayer) {
731 GraphicsLayer::unregisterContentsLayer(m_webLayer); 743 GraphicsLayer::unregisterContentsLayer(m_webLayer);
732 m_webLayer = nullptr; 744 m_webLayer = nullptr;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 // frame view. 989 // frame view.
978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 990 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
979 } 991 }
980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 992 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
981 // Convert to the plugin position. 993 // Convert to the plugin position.
982 for (size_t i = 0; i < cutOutRects.size(); i++) 994 for (size_t i = 0; i < cutOutRects.size(); i++)
983 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 995 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
984 } 996 }
985 997
986 } // namespace blink 998 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698