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

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

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tests now seem to pass. Created 6 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
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "WebViewImpl.h" 42 #include "WebViewImpl.h"
43 #include "core/page/Chrome.h" 43 #include "core/page/Chrome.h"
44 #include "core/page/EventHandler.h" 44 #include "core/page/EventHandler.h"
45 #include "platform/exported/WrappedResourceResponse.h" 45 #include "platform/exported/WrappedResourceResponse.h"
46 46
47 #include "HTMLNames.h" 47 #include "HTMLNames.h"
48 #include "WebPrintParams.h" 48 #include "WebPrintParams.h"
49 #include "bindings/v8/ScriptController.h" 49 #include "bindings/v8/ScriptController.h"
50 #include "core/clipboard/Clipboard.h" 50 #include "core/clipboard/Clipboard.h"
51 #include "core/clipboard/DataObject.h" 51 #include "core/clipboard/DataObject.h"
52 #include "core/dom/EventHandlerRegistry.h"
52 #include "core/events/GestureEvent.h" 53 #include "core/events/GestureEvent.h"
53 #include "core/events/KeyboardEvent.h" 54 #include "core/events/KeyboardEvent.h"
54 #include "core/events/MouseEvent.h" 55 #include "core/events/MouseEvent.h"
55 #include "core/events/ThreadLocalEventNames.h" 56 #include "core/events/ThreadLocalEventNames.h"
56 #include "core/events/TouchEvent.h" 57 #include "core/events/TouchEvent.h"
57 #include "core/events/WheelEvent.h" 58 #include "core/events/WheelEvent.h"
58 #include "core/html/HTMLFormElement.h" 59 #include "core/html/HTMLFormElement.h"
59 #include "core/html/HTMLPlugInElement.h" 60 #include "core/html/HTMLPlugInElement.h"
60 #include "core/loader/FormState.h" 61 #include "core/loader/FormState.h"
61 #include "core/loader/FrameLoadRequest.h" 62 #include "core/loader/FrameLoadRequest.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return false; 511 return false;
511 return nodes.first().get() == m_element; 512 return nodes.first().get() == m_element;
512 } 513 }
513 514
514 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request Type) 515 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request Type)
515 { 516 {
516 if (m_touchEventRequestType == requestType) 517 if (m_touchEventRequestType == requestType)
517 return; 518 return;
518 519
519 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T ouchEventRequestTypeNone) 520 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T ouchEventRequestTypeNone)
520 m_element->document().didAddTouchEventHandler(m_element); 521 EventHandlerRegistry::from(m_element->document())->didAddEventHandler(*m _element, EventTypeNames::touchstart);
521 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone) 522 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone)
522 m_element->document().didRemoveTouchEventHandler(m_element); 523 EventHandlerRegistry::from(m_element->document())->didRemoveEventHandler (*m_element, EventTypeNames::touchstart);
523 m_touchEventRequestType = requestType; 524 m_touchEventRequestType = requestType;
524 } 525 }
525 526
526 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) 527 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents)
527 { 528 {
528 if (m_wantsWheelEvents == wantsWheelEvents) 529 if (m_wantsWheelEvents == wantsWheelEvents)
529 return; 530 return;
530 m_wantsWheelEvents = wantsWheelEvents; 531 m_wantsWheelEvents = wantsWheelEvents;
531 if (Page* page = m_element->document().page()) { 532 if (Page* page = m_element->document().page()) {
532 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor()) { 533 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor()) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 , m_webPlugin(webPlugin) 664 , m_webPlugin(webPlugin)
664 , m_webLayer(0) 665 , m_webLayer(0)
665 , m_touchEventRequestType(TouchEventRequestTypeNone) 666 , m_touchEventRequestType(TouchEventRequestTypeNone)
666 , m_wantsWheelEvents(false) 667 , m_wantsWheelEvents(false)
667 { 668 {
668 } 669 }
669 670
670 WebPluginContainerImpl::~WebPluginContainerImpl() 671 WebPluginContainerImpl::~WebPluginContainerImpl()
671 { 672 {
672 if (m_touchEventRequestType != TouchEventRequestTypeNone) 673 if (m_touchEventRequestType != TouchEventRequestTypeNone)
673 m_element->document().didRemoveTouchEventHandler(m_element); 674 EventHandlerRegistry::from(m_element->document())->didRemoveEventHandler (*m_element, EventTypeNames::touchstart);
674 675
675 for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) 676 for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i)
676 m_pluginLoadObservers[i]->clearPluginContainer(); 677 m_pluginLoadObservers[i]->clearPluginContainer();
677 m_webPlugin->destroy(); 678 m_webPlugin->destroy();
678 if (m_webLayer) 679 if (m_webLayer)
679 GraphicsLayer::unregisterContentsLayer(m_webLayer); 680 GraphicsLayer::unregisterContentsLayer(m_webLayer);
680 } 681 }
681 682
682 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) 683 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
683 { 684 {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 // Take our element and get the clip rect from the enclosing layer and 922 // Take our element and get the clip rect from the enclosing layer and
922 // frame view. 923 // frame view.
923 clipRect.intersect( 924 clipRect.intersect(
924 m_element->document().view()->windowClipRectForFrameOwner(m_element) ); 925 m_element->document().view()->windowClipRectForFrameOwner(m_element) );
925 } 926 }
926 927
927 return clipRect; 928 return clipRect;
928 } 929 }
929 930
930 } // namespace blink 931 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698