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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "HTMLPlugInElement.h" | 60 #include "HTMLPlugInElement.h" |
61 #include "IFrameShimSupport.h" | 61 #include "IFrameShimSupport.h" |
62 #include "KeyboardCodes.h" | 62 #include "KeyboardCodes.h" |
63 #include "KeyboardEvent.h" | 63 #include "KeyboardEvent.h" |
64 #include "MouseEvent.h" | 64 #include "MouseEvent.h" |
65 #include "Page.h" | 65 #include "Page.h" |
66 #include "RenderBox.h" | 66 #include "RenderBox.h" |
67 #include "ScrollAnimator.h" | 67 #include "ScrollAnimator.h" |
68 #include "ScrollView.h" | 68 #include "ScrollView.h" |
69 #include "ScrollbarTheme.h" | 69 #include "ScrollbarTheme.h" |
| 70 #include "ScrollingCoordinator.h" |
70 #include "TouchEvent.h" | 71 #include "TouchEvent.h" |
71 #include "UserGestureIndicator.h" | 72 #include "UserGestureIndicator.h" |
72 #include "WebPrintParams.h" | 73 #include "WebPrintParams.h" |
73 #include "WheelEvent.h" | 74 #include "WheelEvent.h" |
74 #include <public/Platform.h> | 75 #include <public/Platform.h> |
75 #include <public/WebClipboard.h> | 76 #include <public/WebClipboard.h> |
76 #include <public/WebCompositorSupport.h> | 77 #include <public/WebCompositorSupport.h> |
77 #include <public/WebDragData.h> | 78 #include <public/WebDragData.h> |
78 #include <public/WebExternalTextureLayer.h> | 79 #include <public/WebExternalTextureLayer.h> |
79 #include <public/WebRect.h> | 80 #include <public/WebRect.h> |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 { | 526 { |
526 if (m_isAcceptingTouchEvents == acceptingTouchEvents) | 527 if (m_isAcceptingTouchEvents == acceptingTouchEvents) |
527 return; | 528 return; |
528 m_isAcceptingTouchEvents = acceptingTouchEvents; | 529 m_isAcceptingTouchEvents = acceptingTouchEvents; |
529 if (m_isAcceptingTouchEvents) | 530 if (m_isAcceptingTouchEvents) |
530 m_element->document()->didAddTouchEventHandler(); | 531 m_element->document()->didAddTouchEventHandler(); |
531 else | 532 else |
532 m_element->document()->didRemoveTouchEventHandler(); | 533 m_element->document()->didRemoveTouchEventHandler(); |
533 } | 534 } |
534 | 535 |
| 536 void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) |
| 537 { |
| 538 if (m_wantsWheelEvents == wantsWheelEvents) |
| 539 return; |
| 540 m_wantsWheelEvents = wantsWheelEvents; |
| 541 if (Page* page = m_element->document()->page()) { |
| 542 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) { |
| 543 if (parent() && parent()->isFrameView()) |
| 544 scrollingCoordinator->frameViewLayoutUpdated(static_cast<FrameVi
ew*>(parent())); |
| 545 } |
| 546 } |
| 547 } |
| 548 |
535 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response
) | 549 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response
) |
536 { | 550 { |
537 // Make sure that the plugin receives window geometry before data, or else | 551 // Make sure that the plugin receives window geometry before data, or else |
538 // plugins misbehave. | 552 // plugins misbehave. |
539 frameRectsChanged(); | 553 frameRectsChanged(); |
540 | 554 |
541 WrappedResourceResponse urlResponse(response); | 555 WrappedResourceResponse urlResponse(response); |
542 m_webPlugin->didReceiveResponse(urlResponse); | 556 m_webPlugin->didReceiveResponse(urlResponse); |
543 } | 557 } |
544 | 558 |
(...skipping 30 matching lines...) Expand all Loading... |
575 bool WebPluginContainerImpl::supportsKeyboardFocus() const | 589 bool WebPluginContainerImpl::supportsKeyboardFocus() const |
576 { | 590 { |
577 return m_webPlugin->supportsKeyboardFocus(); | 591 return m_webPlugin->supportsKeyboardFocus(); |
578 } | 592 } |
579 | 593 |
580 bool WebPluginContainerImpl::canProcessDrag() const | 594 bool WebPluginContainerImpl::canProcessDrag() const |
581 { | 595 { |
582 return m_webPlugin->canProcessDrag(); | 596 return m_webPlugin->canProcessDrag(); |
583 } | 597 } |
584 | 598 |
| 599 bool WebPluginContainerImpl::wantsWheelEvents() |
| 600 { |
| 601 return m_wantsWheelEvents; |
| 602 } |
| 603 |
585 void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver
* observer) | 604 void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver
* observer) |
586 { | 605 { |
587 size_t pos = m_pluginLoadObservers.find(observer); | 606 size_t pos = m_pluginLoadObservers.find(observer); |
588 if (pos == notFound) | 607 if (pos == notFound) |
589 return; | 608 return; |
590 m_pluginLoadObservers.remove(pos); | 609 m_pluginLoadObservers.remove(pos); |
591 } | 610 } |
592 | 611 |
593 #if USE(ACCELERATED_COMPOSITING) | 612 #if USE(ACCELERATED_COMPOSITING) |
594 WebLayer* WebPluginContainerImpl::platformLayer() const | 613 WebLayer* WebPluginContainerImpl::platformLayer() const |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 | 653 |
635 WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme
nt, WebPlugin* webPlugin) | 654 WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme
nt, WebPlugin* webPlugin) |
636 : WebCore::PluginViewBase(0) | 655 : WebCore::PluginViewBase(0) |
637 , m_element(element) | 656 , m_element(element) |
638 , m_webPlugin(webPlugin) | 657 , m_webPlugin(webPlugin) |
639 #if USE(ACCELERATED_COMPOSITING) | 658 #if USE(ACCELERATED_COMPOSITING) |
640 , m_textureId(0) | 659 , m_textureId(0) |
641 , m_ioSurfaceId(0) | 660 , m_ioSurfaceId(0) |
642 #endif | 661 #endif |
643 , m_isAcceptingTouchEvents(false) | 662 , m_isAcceptingTouchEvents(false) |
| 663 , m_wantsWheelEvents(false) |
644 { | 664 { |
645 } | 665 } |
646 | 666 |
647 WebPluginContainerImpl::~WebPluginContainerImpl() | 667 WebPluginContainerImpl::~WebPluginContainerImpl() |
648 { | 668 { |
649 #if USE(ACCELERATED_COMPOSITING) | 669 #if USE(ACCELERATED_COMPOSITING) |
650 if (m_textureLayer) | 670 if (m_textureLayer) |
651 GraphicsLayerChromium::unregisterContentsLayer(m_textureLayer->layer()); | 671 GraphicsLayerChromium::unregisterContentsLayer(m_textureLayer->layer()); |
652 if (m_ioSurfaceLayer) | 672 if (m_ioSurfaceLayer) |
653 GraphicsLayerChromium::unregisterContentsLayer(m_ioSurfaceLayer->layer()
); | 673 GraphicsLayerChromium::unregisterContentsLayer(m_ioSurfaceLayer->layer()
); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 // Take our element and get the clip rect from the enclosing layer and | 863 // Take our element and get the clip rect from the enclosing layer and |
844 // frame view. | 864 // frame view. |
845 clipRect.intersect( | 865 clipRect.intersect( |
846 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); | 866 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); |
847 } | 867 } |
848 | 868 |
849 return clipRect; | 869 return clipRect; |
850 } | 870 } |
851 | 871 |
852 } // namespace WebKit | 872 } // namespace WebKit |
OLD | NEW |