| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (!widget) | 108 if (!widget) |
| 109 return; | 109 return; |
| 110 widget->handleEvent(event); | 110 widget->handleEvent(event); |
| 111 } | 111 } |
| 112 | 112 |
| 113 RenderWidget* HTMLAppletElement::renderWidgetForJSBindings() | 113 RenderWidget* HTMLAppletElement::renderWidgetForJSBindings() |
| 114 { | 114 { |
| 115 if (!canEmbedJava()) | 115 if (!canEmbedJava()) |
| 116 return 0; | 116 return 0; |
| 117 | 117 |
| 118 if (!renderer() || !renderer()->isApplet()) |
| 119 return 0; |
| 120 |
| 118 RenderApplet* applet = toRenderApplet(renderer()); | 121 RenderApplet* applet = toRenderApplet(renderer()); |
| 119 if (applet) | 122 applet->createWidgetIfNecessary(); |
| 120 applet->createWidgetIfNecessary(); | |
| 121 | |
| 122 return applet; | 123 return applet; |
| 123 } | 124 } |
| 124 | 125 |
| 125 bool HTMLAppletElement::canEmbedJava() const | 126 bool HTMLAppletElement::canEmbedJava() const |
| 126 { | 127 { |
| 127 if (document()->isSandboxed(SandboxPlugins)) | 128 if (document()->isSandboxed(SandboxPlugins)) |
| 128 return false; | 129 return false; |
| 129 | 130 |
| 130 Settings* settings = document()->settings(); | 131 Settings* settings = document()->settings(); |
| 131 return settings && settings->isJavaEnabled(); | 132 return settings && settings->isJavaEnabled(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void HTMLAppletElement::finishParsingChildren() | 135 void HTMLAppletElement::finishParsingChildren() |
| 135 { | 136 { |
| 136 // The parser just reached </applet>, so all the params are available now. | 137 // The parser just reached </applet>, so all the params are available now. |
| 137 HTMLPlugInElement::finishParsingChildren(); | 138 HTMLPlugInElement::finishParsingChildren(); |
| 138 if (renderer()) | 139 if (renderer()) |
| 139 renderer()->setNeedsLayout(true); // This will cause it to create its wi
dget & the Java applet | 140 renderer()->setNeedsLayout(true); // This will cause it to create its wi
dget & the Java applet |
| 140 } | 141 } |
| 141 | 142 |
| 142 } | 143 } |
| OLD | NEW |