| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@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, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 using namespace HTMLNames; | 47 using namespace HTMLNames; |
| 48 | 48 |
| 49 static const float replacementTextRoundedRectHeight = 18; | 49 static const float replacementTextRoundedRectHeight = 18; |
| 50 static const float replacementTextRoundedRectLeftRightTextMargin = 6; | 50 static const float replacementTextRoundedRectLeftRightTextMargin = 6; |
| 51 static const float replacementTextRoundedRectOpacity = 0.20f; | 51 static const float replacementTextRoundedRectOpacity = 0.20f; |
| 52 static const float replacementTextRoundedRectRadius = 5; | 52 static const float replacementTextRoundedRectRadius = 5; |
| 53 static const float replacementTextTextOpacity = 0.55f; | 53 static const float replacementTextTextOpacity = 0.55f; |
| 54 | 54 |
| 55 RenderEmbeddedObject::RenderEmbeddedObject(Element* element) | 55 RenderEmbeddedObject::RenderEmbeddedObject(Element* element) |
| 56 : RenderPart(element) | 56 : LayoutPart(element) |
| 57 , m_showsUnavailablePluginIndicator(false) | 57 , m_showsUnavailablePluginIndicator(false) |
| 58 { | 58 { |
| 59 view()->frameView()->setIsVisuallyNonEmpty(); | 59 view()->frameView()->setIsVisuallyNonEmpty(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 RenderEmbeddedObject::~RenderEmbeddedObject() | 62 RenderEmbeddedObject::~RenderEmbeddedObject() |
| 63 { | 63 { |
| 64 } | 64 } |
| 65 | 65 |
| 66 LayerType RenderEmbeddedObject::layerTypeRequired() const | 66 LayerType RenderEmbeddedObject::layerTypeRequired() const |
| 67 { | 67 { |
| 68 // This can't just use RenderPart::layerTypeRequired, because LayerComposito
r | 68 // This can't just use LayoutPart::layerTypeRequired, because LayerComposito
r |
| 69 // doesn't loop through RenderEmbeddedObjects the way it does frames in orde
r | 69 // doesn't loop through RenderEmbeddedObjects the way it does frames in orde
r |
| 70 // to update the self painting bit on their Layer. | 70 // to update the self painting bit on their Layer. |
| 71 // Also, unlike iframes, embeds don't used the usesCompositing bit on Render
View | 71 // Also, unlike iframes, embeds don't used the usesCompositing bit on Render
View |
| 72 // in requiresAcceleratedCompositing. | 72 // in requiresAcceleratedCompositing. |
| 73 if (requiresAcceleratedCompositing()) | 73 if (requiresAcceleratedCompositing()) |
| 74 return NormalLayer; | 74 return NormalLayer; |
| 75 return RenderPart::layerTypeRequired(); | 75 return LayoutPart::layerTypeRequired(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static String unavailablePluginReplacementText(Node* node, RenderEmbeddedObject:
:PluginUnavailabilityReason pluginUnavailabilityReason) | 78 static String unavailablePluginReplacementText(Node* node, RenderEmbeddedObject:
:PluginUnavailabilityReason pluginUnavailabilityReason) |
| 79 { | 79 { |
| 80 Locale& locale = node ? toElement(node)->locale() : Locale::defaultLocale(); | 80 Locale& locale = node ? toElement(node)->locale() : Locale::defaultLocale(); |
| 81 switch (pluginUnavailabilityReason) { | 81 switch (pluginUnavailabilityReason) { |
| 82 case RenderEmbeddedObject::PluginMissing: | 82 case RenderEmbeddedObject::PluginMissing: |
| 83 return locale.queryString(WebLocalizedString::MissingPluginText); | 83 return locale.queryString(WebLocalizedString::MissingPluginText); |
| 84 case RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy: | 84 case RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy: |
| 85 return locale.queryString(WebLocalizedString::BlockedPluginText); | 85 return locale.queryString(WebLocalizedString::BlockedPluginText); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 102 { | 102 { |
| 103 return m_showsUnavailablePluginIndicator; | 103 return m_showsUnavailablePluginIndicator; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void RenderEmbeddedObject::paintContents(const PaintInfo& paintInfo, const Layou
tPoint& paintOffset) | 106 void RenderEmbeddedObject::paintContents(const PaintInfo& paintInfo, const Layou
tPoint& paintOffset) |
| 107 { | 107 { |
| 108 Element* element = toElement(node()); | 108 Element* element = toElement(node()); |
| 109 if (!isHTMLPlugInElement(element)) | 109 if (!isHTMLPlugInElement(element)) |
| 110 return; | 110 return; |
| 111 | 111 |
| 112 RenderPart::paintContents(paintInfo, paintOffset); | 112 LayoutPart::paintContents(paintInfo, paintOffset); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void RenderEmbeddedObject::paint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 115 void RenderEmbeddedObject::paint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
| 116 { | 116 { |
| 117 if (showsUnavailablePluginIndicator()) { | 117 if (showsUnavailablePluginIndicator()) { |
| 118 LayoutReplaced::paint(paintInfo, paintOffset); | 118 LayoutReplaced::paint(paintInfo, paintOffset); |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 | 121 |
| 122 RenderPart::paint(paintInfo, paintOffset); | 122 LayoutPart::paint(paintInfo, paintOffset); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void RenderEmbeddedObject::paintReplaced(const PaintInfo& paintInfo, const Layou
tPoint& paintOffset) | 125 void RenderEmbeddedObject::paintReplaced(const PaintInfo& paintInfo, const Layou
tPoint& paintOffset) |
| 126 { | 126 { |
| 127 if (!showsUnavailablePluginIndicator()) | 127 if (!showsUnavailablePluginIndicator()) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 if (paintInfo.phase == PaintPhaseSelection) | 130 if (paintInfo.phase == PaintPhaseSelection) |
| 131 return; | 131 return; |
| 132 | 132 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 RenderBox* RenderEmbeddedObject::embeddedContentBox() const | 216 RenderBox* RenderEmbeddedObject::embeddedContentBox() const |
| 217 { | 217 { |
| 218 if (!node() || !widget() || !widget()->isFrameView()) | 218 if (!node() || !widget() || !widget()->isFrameView()) |
| 219 return 0; | 219 return 0; |
| 220 return toFrameView(widget())->embeddedContentBox(); | 220 return toFrameView(widget())->embeddedContentBox(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |