Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 34623002: Move the follwing members from HTMLPlugInImageElement to HTMLPlugInElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/html/HTMLPlugInImageElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
+
}
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/html/HTMLPlugInImageElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698