| Index: Source/core/html/HTMLPlugInElement.cpp
|
| diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp
|
| index e7550e9fbc7f74d6790778fb248d2853b64e0c52..a35467ce683390a97be71cc33030e9545f0457bc 100644
|
| --- a/Source/core/html/HTMLPlugInElement.cpp
|
| +++ b/Source/core/html/HTMLPlugInElement.cpp
|
| @@ -29,8 +29,10 @@
|
| #include "bindings/v8/npruntime_impl.h"
|
| #include "core/dom/Document.h"
|
| #include "core/events/Event.h"
|
| +#include "core/loader/FrameLoaderClient.h"
|
| #include "core/page/EventHandler.h"
|
| #include "core/frame/Frame.h"
|
| +#include "core/platform/MIMETypeFromURL.h"
|
| #include "core/plugins/PluginView.h"
|
| #include "core/rendering/RenderEmbeddedObject.h"
|
| #include "core/rendering/RenderWidget.h"
|
| @@ -42,11 +44,12 @@ namespace WebCore {
|
|
|
| using namespace HTMLNames;
|
|
|
| -HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc)
|
| +HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc, PreferPlugInsForImagesOption preferPlugInsForImagesOption)
|
| : HTMLFrameOwnerElement(tagName, doc)
|
| , m_NPObject(0)
|
| , m_isCapturingMouseEvents(false)
|
| , m_inBeforeLoadEventHandler(false)
|
| + , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
|
| , m_displayState(Playing)
|
| {
|
| }
|
| @@ -248,4 +251,17 @@ NPObject* HTMLPlugInElement::getNPObject()
|
| return m_NPObject;
|
| }
|
|
|
| +bool HTMLPlugInElement::isImageType()
|
| +{
|
| + if (m_serviceType.isEmpty() && protocolIs(m_url, "data"))
|
| + m_serviceType = mimeTypeFromDataURL(m_url);
|
| +
|
| + if (Frame* frame = document().frame()) {
|
| + KURL completedURL = document().completeURL(m_url);
|
| + return frame->loader()->client()->objectContentType(completedURL, m_serviceType, shouldPreferPlugInsForImages()) == ObjectContentImage;
|
| + }
|
| +
|
| + return Image::supportsType(m_serviceType);
|
| +}
|
| +
|
| }
|
|
|