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

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

Issue 1318703002: Revert of Remove javaEnabled setting. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/HTMLAppletElement.h ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAppletElement.cpp
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp
index 7d63cb481e1399544cc7281ab0f3b4d452369053..af9de0c88e87fca22ffd82d0d6118bbd4bc7fb16 100644
--- a/Source/core/html/HTMLAppletElement.cpp
+++ b/Source/core/html/HTMLAppletElement.cpp
@@ -92,12 +92,20 @@
LayoutObject* HTMLAppletElement::createLayoutObject(const ComputedStyle& style)
{
- return LayoutObject::createObject(this, style);
+ if (!canEmbedJava() || openShadowRoot())
+ return LayoutObject::createObject(this, style);
+
+ if (usePlaceholderContent())
+ return new LayoutBlockFlow(this);
+
+ return new LayoutApplet(this);
}
LayoutPart* HTMLAppletElement::layoutPartForJSBindings() const
{
- return nullptr;
+ if (!canEmbedJava())
+ return nullptr;
+ return HTMLPlugInElement::layoutPartForJSBindings();
}
LayoutPart* HTMLAppletElement::existingLayoutPart() const
@@ -201,6 +209,21 @@
}
}
+bool HTMLAppletElement::canEmbedJava() const
+{
+ if (document().isSandboxed(SandboxPlugins))
+ return false;
+
+ Settings* settings = document().settings();
+ if (!settings)
+ return false;
+
+ if (!settings->javaEnabled())
+ return false;
+
+ return true;
+}
+
bool HTMLAppletElement::canEmbedURL(const KURL& url) const
{
if (!document().securityOrigin()->canDisplay(url)) {
« no previous file with comments | « Source/core/html/HTMLAppletElement.h ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698