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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 #endif | 108 #endif |
109 | 109 |
110 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) | 110 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) |
111 { | 111 { |
112 if (m_persistedPluginWidget == widget) | 112 if (m_persistedPluginWidget == widget) |
113 return; | 113 return; |
114 #if ENABLE(OILPAN) | 114 #if ENABLE(OILPAN) |
115 unregisterAsRenderlessIfNeeded(); | 115 unregisterAsRenderlessIfNeeded(); |
116 registerAsRenderless(widget); | 116 registerAsRenderless(widget); |
| 117 if (m_persistedPluginWidget) |
| 118 m_persistedPluginWidget->dispose(); |
117 #endif | 119 #endif |
118 m_persistedPluginWidget = widget; | 120 m_persistedPluginWidget = widget; |
119 } | 121 } |
120 | 122 |
121 #if ENABLE(OILPAN) | 123 #if ENABLE(OILPAN) |
122 bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded() | 124 bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded() |
123 { | 125 { |
124 if (!m_persistedPluginWidget || !m_persistedPluginWidget->isPluginView()) | 126 if (!m_persistedPluginWidget || !m_persistedPluginWidget->isPluginView()) |
125 return false; | 127 return false; |
126 | 128 |
127 // If we are in a renderer-less state, keep the registration. | |
128 if (!layoutEmbeddedObject()) | |
129 return false; | |
130 | |
131 LocalFrame* frame = toPluginView(m_persistedPluginWidget.get())->pluginFrame
(); | 129 LocalFrame* frame = toPluginView(m_persistedPluginWidget.get())->pluginFrame
(); |
132 ASSERT(frame); | 130 ASSERT(frame); |
133 frame->unregisterPluginElement(this); | 131 frame->unregisterPluginElement(this); |
134 return true; | 132 return true; |
135 } | 133 } |
136 | 134 |
137 void HTMLPlugInElement::registerAsRenderless(Widget* widget) | 135 void HTMLPlugInElement::registerAsRenderless(Widget* widget) |
138 { | 136 { |
139 if (!widget || !widget->isPluginView()) | 137 if (!widget || !widget->isPluginView()) |
140 return; | 138 return; |
141 | 139 |
142 LocalFrame* frame = toPluginView(widget)->pluginFrame(); | 140 LocalFrame* frame = toPluginView(widget)->pluginFrame(); |
143 ASSERT(frame); | 141 ASSERT(frame); |
144 frame->registerPluginElement(this); | 142 frame->registerPluginElement(this); |
145 } | 143 } |
146 #endif | 144 #endif |
147 | 145 |
148 PassRefPtrWillBeRawPtr<Widget> HTMLPlugInElement::releasePersistedPluginWidget() | 146 PassRefPtrWillBeRawPtr<Widget> HTMLPlugInElement::releasePersistedPluginWidget() |
149 { | 147 { |
150 #if ENABLE(OILPAN) | 148 #if ENABLE(OILPAN) |
151 unregisterAsRenderlessIfNeeded(); | 149 // If we are in a renderer-less state, keep the registration. |
| 150 if (layoutEmbeddedObject()) |
| 151 unregisterAsRenderlessIfNeeded(); |
152 #endif | 152 #endif |
153 return m_persistedPluginWidget.release(); | 153 return m_persistedPluginWidget.release(); |
154 } | 154 } |
155 | 155 |
156 bool HTMLPlugInElement::canProcessDrag() const | 156 bool HTMLPlugInElement::canProcessDrag() const |
157 { | 157 { |
158 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug
inWidget())->canProcessDrag(); | 158 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug
inWidget())->canProcessDrag(); |
159 } | 159 } |
160 | 160 |
161 bool HTMLPlugInElement::willRespondToMouseClickEvents() | 161 bool HTMLPlugInElement::willRespondToMouseClickEvents() |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 return openShadowRoot(); | 661 return openShadowRoot(); |
662 } | 662 } |
663 | 663 |
664 void HTMLPlugInElement::lazyReattachIfNeeded() | 664 void HTMLPlugInElement::lazyReattachIfNeeded() |
665 { | 665 { |
666 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) | 666 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) |
667 lazyReattachIfAttached(); | 667 lazyReattachIfAttached(); |
668 } | 668 } |
669 | 669 |
670 } | 670 } |
OLD | NEW |