本文整理汇总了C++中HTMLAppletElement::isInUserAgentShadowTree方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLAppletElement::isInUserAgentShadowTree方法的具体用法?C++ HTMLAppletElement::isInUserAgentShadowTree怎么用?C++ HTMLAppletElement::isInUserAgentShadowTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLAppletElement
的用法示例。
在下文中一共展示了HTMLAppletElement::isInUserAgentShadowTree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
String baseURLString;
String codeBaseURLString;
for (size_t i = 0; i < paramNames.size(); ++i) {
if (equalLettersIgnoringASCIICase(paramNames[i], "baseurl"))
baseURLString = paramValues[i];
else if (equalLettersIgnoringASCIICase(paramNames[i], "codebase"))
codeBaseURLString = paramValues[i];
}
if (!codeBaseURLString.isEmpty()) {
URL codeBaseURL = completeURL(codeBaseURLString);
if (!element.document().securityOrigin()->canDisplay(codeBaseURL)) {
FrameLoader::reportLocalLoadFailed(&m_frame, codeBaseURL.string());
return nullptr;
}
const char javaAppletMimeType[] = "application/x-java-applet";
ASSERT(element.document().contentSecurityPolicy());
auto& contentSecurityPolicy = *element.document().contentSecurityPolicy();
// Elements in user agent show tree should load whatever the embedding document policy is.
if (!element.isInUserAgentShadowTree()
&& (!contentSecurityPolicy.allowObjectFromSource(codeBaseURL) || !contentSecurityPolicy.allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL)))
return nullptr;
}
if (baseURLString.isEmpty())
baseURLString = m_frame.document()->baseURL().string();
URL baseURL = completeURL(baseURLString);
RefPtr<Widget> widget;
if (allowPlugins())
widget = m_frame.loader().client().createJavaAppletWidget(size, &element, baseURL, paramNames, paramValues);
logPluginRequest(document()->page(), element.serviceType(), String(), widget);
if (!widget) {
RenderEmbeddedObject* renderer = element.renderEmbeddedObject();
if (!renderer->isPluginUnavailable())
renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
return nullptr;
}
m_containsPlugins = true;
return widget;
}