static void addPlugInsFromNodeListMatchingOriginHash(HTMLPlugInImageElementList& plugInList, PassRefPtr<NodeList> collection, unsigned originHash) { for (unsigned i = 0, length = collection->length(); i < length; i++) { Node* node = collection->item(i); if (node->isPluginElement()) { HTMLPlugInElement* plugInElement = toHTMLPlugInElement(node); if (plugInElement->isPlugInImageElement() && plugInElement->displayState() <= HTMLPlugInElement::DisplayingSnapshot && plugInElement->plugInOriginHash() == originHash) plugInList.append(toHTMLPlugInImageElement(node)); } } }
static void addPlugInsFromNodeListMatchingPlugInOrigin(HTMLPlugInImageElementList& plugInList, PassRefPtr<NodeList> collection, const String& plugInOrigin, const String& mimeType) { for (unsigned i = 0, length = collection->length(); i < length; i++) { Node* node = collection->item(i); if (node->isPluginElement()) { HTMLPlugInElement* plugInElement = toHTMLPlugInElement(node); if (plugInElement->isPlugInImageElement()) { HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(node); const KURL& loadedURL = plugInImageElement->loadedUrl(); String otherMimeType = plugInImageElement->loadedMimeType(); if (plugInOrigin == loadedURL.host() && mimeType == otherMimeType) plugInList.append(plugInImageElement); } } } }
void RenderEmbeddedObject::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset) { if (!element() || !element()->isPluginElement()) return; HTMLPlugInElement* plugInElement = toHTMLPlugInElement(element()); if (plugInElement->displayState() > HTMLPlugInElement::DisplayingSnapshot) { RenderPart::paintContents(paintInfo, paintOffset); if (!plugInElement->isRestartedPlugin()) return; } if (!plugInElement->isPlugInImageElement()) return; Image* snapshot = toHTMLPlugInImageElement(plugInElement)->snapshotImage(); if (snapshot) paintSnapshotImage(paintInfo, paintOffset, snapshot); }