OLD | NEW |
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 Loading... |
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/TouchEvent.h" | 56 #include "core/events/TouchEvent.h" |
56 #include "core/events/WheelEvent.h" | 57 #include "core/events/WheelEvent.h" |
57 #include "core/html/HTMLFormElement.h" | 58 #include "core/html/HTMLFormElement.h" |
58 #include "core/html/HTMLPlugInElement.h" | 59 #include "core/html/HTMLPlugInElement.h" |
59 #include "core/loader/FormState.h" | 60 #include "core/loader/FormState.h" |
60 #include "core/loader/FrameLoadRequest.h" | 61 #include "core/loader/FrameLoadRequest.h" |
61 #include "core/page/FocusController.h" | 62 #include "core/page/FocusController.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 return false; | 512 return false; |
512 return nodes.first().get() == m_element; | 513 return nodes.first().get() == m_element; |
513 } | 514 } |
514 | 515 |
515 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) | 516 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) |
516 { | 517 { |
517 if (m_touchEventRequestType == requestType) | 518 if (m_touchEventRequestType == requestType) |
518 return; | 519 return; |
519 | 520 |
520 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T
ouchEventRequestTypeNone) | 521 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T
ouchEventRequestTypeNone) |
521 m_element->document().didAddTouchEventHandler(m_element); | 522 EventHandlerRegistry::from(m_element->document())->didAddEventHandler(*m
_element, EventHandlerRegistry::TouchEvent); |
522 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType
!= TouchEventRequestTypeNone) | 523 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType
!= TouchEventRequestTypeNone) |
523 m_element->document().didRemoveTouchEventHandler(m_element); | 524 EventHandlerRegistry::from(m_element->document())->didRemoveEventHandler
(*m_element, EventHandlerRegistry::TouchEvent); |
524 m_touchEventRequestType = requestType; | 525 m_touchEventRequestType = requestType; |
525 } | 526 } |
526 | 527 |
527 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) | 528 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) |
528 { | 529 { |
529 if (m_wantsWheelEvents == wantsWheelEvents) | 530 if (m_wantsWheelEvents == wantsWheelEvents) |
530 return; | 531 return; |
531 m_wantsWheelEvents = wantsWheelEvents; | 532 m_wantsWheelEvents = wantsWheelEvents; |
532 if (Page* page = m_element->document().page()) { | 533 if (Page* page = m_element->document().page()) { |
533 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) { | 534 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 , m_webPlugin(webPlugin) | 665 , m_webPlugin(webPlugin) |
665 , m_webLayer(0) | 666 , m_webLayer(0) |
666 , m_touchEventRequestType(TouchEventRequestTypeNone) | 667 , m_touchEventRequestType(TouchEventRequestTypeNone) |
667 , m_wantsWheelEvents(false) | 668 , m_wantsWheelEvents(false) |
668 { | 669 { |
669 } | 670 } |
670 | 671 |
671 WebPluginContainerImpl::~WebPluginContainerImpl() | 672 WebPluginContainerImpl::~WebPluginContainerImpl() |
672 { | 673 { |
673 if (m_touchEventRequestType != TouchEventRequestTypeNone) | 674 if (m_touchEventRequestType != TouchEventRequestTypeNone) |
674 m_element->document().didRemoveTouchEventHandler(m_element); | 675 EventHandlerRegistry::from(m_element->document())->didRemoveEventHandler
(*m_element, EventHandlerRegistry::TouchEvent); |
675 | 676 |
676 for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) | 677 for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) |
677 m_pluginLoadObservers[i]->clearPluginContainer(); | 678 m_pluginLoadObservers[i]->clearPluginContainer(); |
678 m_webPlugin->destroy(); | 679 m_webPlugin->destroy(); |
679 if (m_webLayer) | 680 if (m_webLayer) |
680 GraphicsLayer::unregisterContentsLayer(m_webLayer); | 681 GraphicsLayer::unregisterContentsLayer(m_webLayer); |
681 } | 682 } |
682 | 683 |
683 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) | 684 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) |
684 { | 685 { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 917 |
917 return clipRect; | 918 return clipRect; |
918 } | 919 } |
919 | 920 |
920 bool WebPluginContainerImpl::pluginShouldPersist() const | 921 bool WebPluginContainerImpl::pluginShouldPersist() const |
921 { | 922 { |
922 return m_webPlugin->shouldPersist(); | 923 return m_webPlugin->shouldPersist(); |
923 } | 924 } |
924 | 925 |
925 } // namespace blink | 926 } // namespace blink |
OLD | NEW |