| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() | 117 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() |
| 118 { | 118 { |
| 119 Frame* frame = document().frame(); | 119 Frame* frame = document().frame(); |
| 120 if (!frame) | 120 if (!frame) |
| 121 return 0; | 121 return 0; |
| 122 | 122 |
| 123 // If the host dynamically turns off JavaScript (or Java) we will still retu
rn | 123 // If the host dynamically turns off JavaScript (or Java) we will still retu
rn |
| 124 // the cached allocated Bindings::Instance. Not supporting this edge-case i
s OK. | 124 // the cached allocated Bindings::Instance. Not supporting this edge-case i
s OK. |
| 125 if (!m_pluginWrapper) { | 125 if (!m_pluginWrapper) { |
| 126 if (Widget* widget = pluginWidget()) | 126 if (Widget* widget = pluginWidget()) |
| 127 m_pluginWrapper = frame->script()->createPluginWrapper(widget); | 127 m_pluginWrapper = frame->script().createPluginWrapper(widget); |
| 128 } | 128 } |
| 129 return m_pluginWrapper.get(); | 129 return m_pluginWrapper.get(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool HTMLPlugInElement::dispatchBeforeLoadEvent(const String& sourceURL) | 132 bool HTMLPlugInElement::dispatchBeforeLoadEvent(const String& sourceURL) |
| 133 { | 133 { |
| 134 // FIXME: Our current plug-in loading design can't guarantee the following | 134 // FIXME: Our current plug-in loading design can't guarantee the following |
| 135 // assertion is true, since plug-in loading can be initiated during layout, | 135 // assertion is true, since plug-in loading can be initiated during layout, |
| 136 // and synchronous layout can be initiated in a beforeload event handler! | 136 // and synchronous layout can be initiated in a beforeload event handler! |
| 137 // See <http://webkit.org/b/71264>. | 137 // See <http://webkit.org/b/71264>. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 if (useFallbackContent() || !renderer() || !renderer()->isEmbeddedObject()) | 241 if (useFallbackContent() || !renderer() || !renderer()->isEmbeddedObject()) |
| 242 return false; | 242 return false; |
| 243 return !toRenderEmbeddedObject(renderer())->showsUnavailablePluginIndicator(
); | 243 return !toRenderEmbeddedObject(renderer())->showsUnavailablePluginIndicator(
); |
| 244 } | 244 } |
| 245 | 245 |
| 246 NPObject* HTMLPlugInElement::getNPObject() | 246 NPObject* HTMLPlugInElement::getNPObject() |
| 247 { | 247 { |
| 248 ASSERT(document().frame()); | 248 ASSERT(document().frame()); |
| 249 if (!m_NPObject) | 249 if (!m_NPObject) |
| 250 m_NPObject = document().frame()->script()->createScriptObjectForPluginEl
ement(this); | 250 m_NPObject = document().frame()->script().createScriptObjectForPluginEle
ment(this); |
| 251 return m_NPObject; | 251 return m_NPObject; |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool HTMLPlugInElement::isImageType() | 254 bool HTMLPlugInElement::isImageType() |
| 255 { | 255 { |
| 256 if (m_serviceType.isEmpty() && protocolIs(m_url, "data")) | 256 if (m_serviceType.isEmpty() && protocolIs(m_url, "data")) |
| 257 m_serviceType = mimeTypeFromDataURL(m_url); | 257 m_serviceType = mimeTypeFromDataURL(m_url); |
| 258 | 258 |
| 259 if (Frame* frame = document().frame()) { | 259 if (Frame* frame = document().frame()) { |
| 260 KURL completedURL = document().completeURL(m_url); | 260 KURL completedURL = document().completeURL(m_url); |
| 261 return frame->loader()->client()->objectContentType(completedURL, m_serv
iceType, shouldPreferPlugInsForImages()) == ObjectContentImage; | 261 return frame->loader()->client()->objectContentType(completedURL, m_serv
iceType, shouldPreferPlugInsForImages()) == ObjectContentImage; |
| 262 } | 262 } |
| 263 | 263 |
| 264 return Image::supportsType(m_serviceType); | 264 return Image::supportsType(m_serviceType); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } | 267 } |
| OLD | NEW |