| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 DEFINE_TRACE(HTMLPlugInElement) | 86 DEFINE_TRACE(HTMLPlugInElement) |
| 87 { | 87 { |
| 88 visitor->trace(m_imageLoader); | 88 visitor->trace(m_imageLoader); |
| 89 visitor->trace(m_persistedPluginWidget); | 89 visitor->trace(m_persistedPluginWidget); |
| 90 HTMLFrameOwnerElement::trace(visitor); | 90 HTMLFrameOwnerElement::trace(visitor); |
| 91 } | 91 } |
| 92 | 92 |
| 93 #if ENABLE(OILPAN) | |
| 94 void HTMLPlugInElement::disconnectContentFrame() | |
| 95 { | |
| 96 if (m_persistedPluginWidget) { | |
| 97 if (m_persistedPluginWidget->isPluginView()) | |
| 98 m_persistedPluginWidget->dispose(); | |
| 99 else | |
| 100 ASSERT(m_persistedPluginWidget->isFrameView()); | |
| 101 m_persistedPluginWidget = nullptr; | |
| 102 } | |
| 103 HTMLFrameOwnerElement::disconnectContentFrame(); | |
| 104 } | |
| 105 | |
| 106 void HTMLPlugInElement::shouldDisposePlugin() | |
| 107 { | |
| 108 if (m_persistedPluginWidget && m_persistedPluginWidget->isPluginView()) | |
| 109 toPluginView(m_persistedPluginWidget.get())->shouldDisposePlugin(); | |
| 110 } | |
| 111 #endif | |
| 112 | |
| 113 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) | 93 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) |
| 114 { | 94 { |
| 115 if (m_persistedPluginWidget == widget) | 95 if (m_persistedPluginWidget == widget) |
| 116 return; | 96 return; |
| 117 #if ENABLE(OILPAN) | 97 #if ENABLE(OILPAN) |
| 118 unregisterAsRenderlessIfNeeded(); | |
| 119 registerAsRenderless(widget); | |
| 120 if (m_persistedPluginWidget) { | 98 if (m_persistedPluginWidget) { |
| 121 if (m_persistedPluginWidget->isPluginView()) { | 99 if (m_persistedPluginWidget->isPluginView()) { |
| 122 m_persistedPluginWidget->hide(); | 100 m_persistedPluginWidget->hide(); |
| 123 m_persistedPluginWidget->dispose(); | 101 m_persistedPluginWidget->dispose(); |
| 124 } else { | 102 } else { |
| 125 ASSERT(m_persistedPluginWidget->isFrameView()); | 103 ASSERT(m_persistedPluginWidget->isFrameView()); |
| 126 } | 104 } |
| 127 } | 105 } |
| 128 #endif | 106 #endif |
| 129 m_persistedPluginWidget = widget; | 107 m_persistedPluginWidget = widget; |
| 130 } | 108 } |
| 131 | 109 |
| 132 #if ENABLE(OILPAN) | |
| 133 bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded() | |
| 134 { | |
| 135 if (!m_persistedPluginWidget || !m_persistedPluginWidget->isPluginView()) | |
| 136 return false; | |
| 137 | |
| 138 LocalFrame* frame = toPluginView(m_persistedPluginWidget.get())->pluginFrame
(); | |
| 139 ASSERT(frame); | |
| 140 frame->unregisterPluginElement(this); | |
| 141 return true; | |
| 142 } | |
| 143 | |
| 144 void HTMLPlugInElement::registerAsRenderless(Widget* widget) | |
| 145 { | |
| 146 if (!widget || !widget->isPluginView()) | |
| 147 return; | |
| 148 | |
| 149 LocalFrame* frame = toPluginView(widget)->pluginFrame(); | |
| 150 ASSERT(frame); | |
| 151 frame->registerPluginElement(this); | |
| 152 } | |
| 153 #endif | |
| 154 | |
| 155 PassRefPtrWillBeRawPtr<Widget> HTMLPlugInElement::releasePersistedPluginWidget() | |
| 156 { | |
| 157 #if ENABLE(OILPAN) | |
| 158 // If we are in a renderer-less state, keep the registration. | |
| 159 if (layoutEmbeddedObject()) | |
| 160 unregisterAsRenderlessIfNeeded(); | |
| 161 #endif | |
| 162 return m_persistedPluginWidget.release(); | |
| 163 } | |
| 164 | |
| 165 bool HTMLPlugInElement::canProcessDrag() const | 110 bool HTMLPlugInElement::canProcessDrag() const |
| 166 { | 111 { |
| 167 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug
inWidget())->canProcessDrag(); | 112 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug
inWidget())->canProcessDrag(); |
| 168 } | 113 } |
| 169 | 114 |
| 170 bool HTMLPlugInElement::willRespondToMouseClickEvents() | 115 bool HTMLPlugInElement::willRespondToMouseClickEvents() |
| 171 { | 116 { |
| 172 if (isDisabledFormControl()) | 117 if (isDisabledFormControl()) |
| 173 return false; | 118 return false; |
| 174 LayoutObject* r = layoutObject(); | 119 LayoutObject* r = layoutObject(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 LayoutEmbeddedObject* layoutObject = layoutEmbeddedObject(); | 499 LayoutEmbeddedObject* layoutObject = layoutEmbeddedObject(); |
| 555 // FIXME: This code should not depend on layoutObject! | 500 // FIXME: This code should not depend on layoutObject! |
| 556 if ((!layoutObject && requireLayoutObject) || useFallback) | 501 if ((!layoutObject && requireLayoutObject) || useFallback) |
| 557 return false; | 502 return false; |
| 558 | 503 |
| 559 WTF_LOG(Plugins, "%p Plugin URL: %s", this, m_url.utf8().data()); | 504 WTF_LOG(Plugins, "%p Plugin URL: %s", this, m_url.utf8().data()); |
| 560 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); | 505 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); |
| 561 m_loadedUrl = url; | 506 m_loadedUrl = url; |
| 562 | 507 |
| 563 if (m_persistedPluginWidget) { | 508 if (m_persistedPluginWidget) { |
| 564 setWidget(releasePersistedPluginWidget()); | 509 setWidget(m_persistedPluginWidget.release()); |
| 565 } else { | 510 } else { |
| 566 bool loadManually = document().isPluginDocument() && !document().contain
sPlugins(); | 511 bool loadManually = document().isPluginDocument() && !document().contain
sPlugins(); |
| 567 FrameLoaderClient::DetachedPluginPolicy policy = requireLayoutObject ? F
rameLoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin; | 512 FrameLoaderClient::DetachedPluginPolicy policy = requireLayoutObject ? F
rameLoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin; |
| 568 RefPtrWillBeRawPtr<Widget> widget = frame->loader().client()->createPlug
in(this, url, paramNames, paramValues, mimeType, loadManually, policy); | 513 RefPtrWillBeRawPtr<Widget> widget = frame->loader().client()->createPlug
in(this, url, paramNames, paramValues, mimeType, loadManually, policy); |
| 569 if (!widget) { | 514 if (!widget) { |
| 570 if (layoutObject && !layoutObject->showsUnavailablePluginIndicator()
) | 515 if (layoutObject && !layoutObject->showsUnavailablePluginIndicator()
) |
| 571 layoutObject->setPluginUnavailabilityReason(LayoutEmbeddedObject
::PluginMissing); | 516 layoutObject->setPluginUnavailabilityReason(LayoutEmbeddedObject
::PluginMissing); |
| 572 return false; | 517 return false; |
| 573 } | 518 } |
| 574 | 519 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 return openShadowRoot(); | 615 return openShadowRoot(); |
| 671 } | 616 } |
| 672 | 617 |
| 673 void HTMLPlugInElement::lazyReattachIfNeeded() | 618 void HTMLPlugInElement::lazyReattachIfNeeded() |
| 674 { | 619 { |
| 675 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) | 620 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) |
| 676 lazyReattachIfAttached(); | 621 lazyReattachIfAttached(); |
| 677 } | 622 } |
| 678 | 623 |
| 679 } | 624 } |
| OLD | NEW |