diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebCore/rendering/RenderEmbeddedObject.cpp | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebCore/rendering/RenderEmbeddedObject.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderEmbeddedObject.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp index 55cfcfd4d..315c16f8a 100644 --- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp +++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp @@ -102,11 +102,28 @@ bool RenderEmbeddedObject::allowsAcceleratedCompositing() const } #endif +static String unavailablePluginReplacementText(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) +{ + switch (pluginUnavailabilityReason) { + case RenderEmbeddedObject::PluginMissing: + return missingPluginText(); + case RenderEmbeddedObject::PluginCrashed: + return crashedPluginText(); + case RenderEmbeddedObject::InsecurePluginVersion: + return insecurePluginVersionText(); + } + + ASSERT_NOT_REACHED(); + return String(); +} + void RenderEmbeddedObject::setPluginUnavailabilityReason(PluginUnavailabilityReason pluginUnavailabilityReason) { ASSERT(!m_showsUnavailablePluginIndicator); m_showsUnavailablePluginIndicator = true; m_pluginUnavailabilityReason = pluginUnavailabilityReason; + + m_unavailablePluginReplacementText = unavailablePluginReplacementText(pluginUnavailabilityReason); } bool RenderEmbeddedObject::showsUnavailablePluginIndicator() const @@ -193,8 +210,8 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul fontDescription.setComputedSize(fontDescription.specifiedSize()); font = Font(fontDescription, 0, 0); font.update(0); - - run = TextRun(unavailablePluginReplacementText()); + + run = TextRun(m_unavailablePluginReplacementText); textWidth = font.width(run); replacementTextRect.setSize(FloatSize(textWidth + replacementTextRoundedRectLeftRightTextMargin * 2, replacementTextRoundedRectHeight)); @@ -207,21 +224,6 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul return true; } -String RenderEmbeddedObject::unavailablePluginReplacementText() const -{ - switch (m_pluginUnavailabilityReason) { - case PluginMissing: - return missingPluginText(); - case PluginCrashed: - return crashedPluginText(); - case InsecurePluginVersion: - return insecurePluginVersionText(); - } - - ASSERT_NOT_REACHED(); - return String(); -} - void RenderEmbeddedObject::layout() { ASSERT(needsLayout()); |