Bug 1038570 - Part 2: rename ObjectFrame class to PluginFrame. r=dbaron

This commit is contained in:
Arnaud Sourioux 2014-09-24 06:34:00 +02:00
parent 4f1c6d56a0
commit 54b32a98a0
19 changed files with 134 additions and 134 deletions

View File

@ -263,11 +263,11 @@ NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback)
#endif
already_AddRefed<Accessible>
nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame,
nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
nsIContent* aContent,
Accessible* aContext)
{
// nsObjectFrame means a plugin, so we need to use the accessibility support
// nsPluginFrame means a plugin, so we need to use the accessibility support
// of the plugin.
if (aFrame->GetRect().IsEmpty())
return nullptr;
@ -1619,7 +1619,7 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
newAcc = new OuterDocAccessible(aContent, document);
break;
case ePluginType: {
nsObjectFrame* objectFrame = do_QueryFrame(aFrame);
nsPluginFrame* objectFrame = do_QueryFrame(aFrame);
newAcc = CreatePluginAccessible(objectFrame, aContent, aContext);
break;
}

View File

@ -15,7 +15,7 @@
#include "nsIObserver.h"
class nsImageFrame;
class nsObjectFrame;
class nsPluginFrame;
class nsITreeView;
namespace mozilla {
@ -63,7 +63,7 @@ public:
virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate);
already_AddRefed<Accessible>
CreatePluginAccessible(nsObjectFrame* aFrame, nsIContent* aContent,
CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
/**

View File

@ -24,7 +24,7 @@ class nsINode;
class nsIContent;
class nsIFrame;
class nsIPresShell;
class nsObjectFrame;
class nsPluginFrame;
// 10ff6dca-b219-4b64-9a4c-67a62b86edce
#define NS_IACCESSIBILITYSERVICE_IID \

View File

@ -860,7 +860,7 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
// dangling. (Bug 854082)
nsIFrame* frame = thisContent->GetPrimaryFrame();
if (frame && mInstanceOwner) {
mInstanceOwner->SetFrame(static_cast<nsObjectFrame*>(frame));
mInstanceOwner->SetFrame(static_cast<nsPluginFrame*>(frame));
// Bug 870216 - Adobe Reader renders with incorrect dimensions until it gets
// a second SetWindow call. This is otherwise redundant.
@ -1296,7 +1296,7 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
// Otherwise, we're just changing frames
// Set up relationship between instance owner and frame.
nsObjectFrame *objFrame = static_cast<nsObjectFrame*>(aFrame);
nsPluginFrame *objFrame = static_cast<nsPluginFrame*>(aFrame);
mInstanceOwner->SetFrame(objFrame);
return NS_OK;
@ -2718,13 +2718,13 @@ nsObjectLoadingContent::GetTypeOfContent(const nsCString& aMIMEType)
return eType_Null;
}
nsObjectFrame*
nsPluginFrame*
nsObjectLoadingContent::GetExistingFrame()
{
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
nsIFrame* frame = thisContent->GetPrimaryFrame();
nsIObjectFrame* objFrame = do_QueryFrame(frame);
return static_cast<nsObjectFrame*>(objFrame);
return static_cast<nsPluginFrame*>(objFrame);
}
void
@ -3576,7 +3576,7 @@ nsObjectLoadingContent::GetPluginJSObject(JSContext *cx,
JS::MutableHandle<JSObject*> plugin_proto)
{
// NB: We need an AutoEnterCompartment because we can be called from
// nsObjectFrame when the plugin loads after the JS object for our content
// nsPluginFrame when the plugin loads after the JS object for our content
// node has been created.
JSAutoCompartment ac(cx, obj);

View File

@ -26,7 +26,7 @@
class nsAsyncInstantiateEvent;
class nsStopPluginRunnable;
class AutoSetInstantiatingToFalse;
class nsObjectFrame;
class nsPluginFrame;
class nsFrameLoader;
class nsXULElement;
class nsPluginInstanceOwner;
@ -502,7 +502,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent
* Gets the frame that's associated with this content node.
* Does not flush.
*/
nsObjectFrame* GetExistingFrame();
nsPluginFrame* GetExistingFrame();
// Helper class for SetupProtoChain
class SetupProtoChainRunner MOZ_FINAL : public nsIRunnable

View File

@ -1680,7 +1680,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
if (pPluginEvent && !pPluginEvent->event) {
// Don't send null events to plugins.
NS_WARNING("nsObjectFrame ProcessEvent: trying to send null event to plugin.");
NS_WARNING("nsPluginFrame ProcessEvent: trying to send null event to plugin.");
return rv;
}
@ -2372,7 +2372,7 @@ nsresult nsPluginInstanceOwner::Init(nsIContent* aContent)
// done at a higher level than this (content).
nsIFrame* frame = aContent->GetPrimaryFrame();
nsIObjectFrame* iObjFrame = do_QueryFrame(frame);
nsObjectFrame* objFrame = static_cast<nsObjectFrame*>(iObjFrame);
nsPluginFrame* objFrame = static_cast<nsPluginFrame*>(iObjFrame);
if (objFrame) {
SetFrame(objFrame);
// Some plugins require a specific sequence of shutdown and startup when
@ -2580,7 +2580,7 @@ void* nsPluginInstanceOwner::FixUpPluginWindow(int32_t inPaintState)
if (!pluginWidget)
return nullptr;
// If we've already set up a CGContext in nsObjectFrame::PaintPlugin(), we
// If we've already set up a CGContext in nsPluginFrame::PaintPlugin(), we
// don't want calls to SetPluginPortAndDetectChange() to step on our work.
if (mInCGPaintLevel < 1) {
SetPluginPortAndDetectChange();
@ -2818,7 +2818,7 @@ nsPluginInstanceOwner::GetContentsScaleFactor(double *result)
return NS_OK;
}
void nsPluginInstanceOwner::SetFrame(nsObjectFrame *aFrame)
void nsPluginInstanceOwner::SetFrame(nsPluginFrame *aFrame)
{
// Don't do anything if the frame situation hasn't changed.
if (mObjectFrame == aFrame) {
@ -2853,7 +2853,7 @@ void nsPluginInstanceOwner::SetFrame(nsObjectFrame *aFrame)
}
}
nsObjectFrame* nsPluginInstanceOwner::GetFrame()
nsPluginFrame* nsPluginInstanceOwner::GetFrame()
{
return mObjectFrame;
}

View File

@ -26,7 +26,7 @@
class nsIInputStream;
struct nsIntRect;
class nsPluginDOMContextMenuListener;
class nsObjectFrame;
class nsPluginFrame;
class nsDisplayListBuilder;
namespace mozilla {
@ -143,9 +143,9 @@ public:
// changed, and SetWindow() needs to be called again.
void* SetPluginPortAndDetectChange();
// Flag when we've set up a Thebes (and CoreGraphics) context in
// nsObjectFrame::PaintPlugin(). We need to know this in
// nsPluginFrame::PaintPlugin(). We need to know this in
// FixUpPluginWindow() (i.e. we need to know when FixUpPluginWindow() has
// been called from nsObjectFrame::PaintPlugin() when we're using the
// been called from nsPluginFrame::PaintPlugin() when we're using the
// CoreGraphics drawing model).
void BeginCGPaint();
void EndCGPaint();
@ -155,8 +155,8 @@ public:
void UpdateDocumentActiveState(bool aIsActive);
#endif // XP_MACOSX
void SetFrame(nsObjectFrame *aFrame);
nsObjectFrame* GetFrame();
void SetFrame(nsPluginFrame *aFrame);
nsPluginFrame* GetFrame();
uint32_t GetLastEventloopNestingLevel() const {
return mLastEventloopNestingLevel;
@ -276,7 +276,7 @@ private:
nsPluginNativeWindow *mPluginWindow;
nsRefPtr<nsNPAPIPluginInstance> mInstance;
nsObjectFrame *mObjectFrame;
nsPluginFrame *mObjectFrame;
nsIContent *mContent; // WEAK, content owns us
nsCString mDocumentBase;
bool mWidgetCreationComplete;

View File

@ -145,7 +145,7 @@ nsresult nsPluginNativeWindowGtk::CallSetWindow(nsRefPtr<nsNPAPIPluginInstance>
// Make sure to resize and re-place the window if required.
SetAllocation();
// Need to reset "window" each time as nsObjectFrame::DidReflow sets it
// Need to reset "window" each time as nsPluginFrame::DidReflow sets it
// to the ancestor window.
#if (MOZ_WIDGET_GTK == 2)
if (GTK_IS_XTBIN(mSocketWidget)) {
@ -225,7 +225,7 @@ nsresult nsPluginNativeWindowGtk::CreateXEmbedWindow(bool aEnableXtFocus) {
SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
// Fill out the ws_info structure.
// (The windowless case is done in nsObjectFrame.cpp.)
// (The windowless case is done in nsPluginFrame.cpp.)
GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, GetWindow());
if(!gdkWindow)
return NS_ERROR_FAILURE;

View File

@ -1948,7 +1948,7 @@ PluginInstanceChild::SharedSurfacePaint(NPEvent& evcopy)
break;
case RENDER_BACK_ONE:
// Handle a double pass render used in alpha extraction for transparent
// plugins. (See nsObjectFrame and gfxWindowsNativeDrawing for details.)
// plugins. (See nsPluginFrame and gfxWindowsNativeDrawing for details.)
// We render twice, once to the shared dib, and once to a cache which
// we copy back on a second paint. These paints can't be spread across
// multiple rpc messages as delays cause animation frame changes.

View File

@ -367,7 +367,7 @@ PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginDrawingModel(
if (drawingModel == NPDrawingModelCoreAnimation ||
drawingModel == NPDrawingModelInvalidatingCoreAnimation) {
// We need to request CoreGraphics otherwise
// the nsObjectFrame will try to draw a CALayer
// the nsPluginFrame will try to draw a CALayer
// that can not be shared across process.
mDrawingModel = drawingModel;
*result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel,
@ -1231,7 +1231,7 @@ PluginInstanceParent::NPP_HandleEvent(void* event)
case WM_WINDOWPOSCHANGED:
{
// We send this in nsObjectFrame just before painting
// We send this in nsPluginFrame just before painting
return SendWindowPosChanged(npremoteevent);
}
break;

View File

@ -100,7 +100,7 @@ pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow)
{
// Ugh. Due to a terrible Gecko bug, we have to ignore position changes
// when the clip rect doesn't change; the position can be wrong
// when set by a path other than nsObjectFrame::FixUpPluginWindow.
// when set by a path other than nsPluginFrame::FixUpPluginWindow.
int32_t oldX = instanceData->window.x;
int32_t oldY = instanceData->window.y;
bool clipChanged =

View File

@ -2860,7 +2860,7 @@ static PLDHashOperator
SetPluginHidden(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg)
{
nsIFrame* root = static_cast<nsIFrame*>(userArg);
nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame());
nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame());
if (!f) {
NS_WARNING("Null frame in SetPluginHidden");
return PL_DHASH_NEXT;
@ -3020,7 +3020,7 @@ SortConfigurations(nsTArray<nsIWidget::Configuration>* aConfigurations)
static PLDHashOperator
PluginDidSetGeometryEnumerator(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg)
{
nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame());
nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame());
if (!f) {
NS_WARNING("Null frame in PluginDidSetGeometryEnumerator");
return PL_DHASH_NEXT;
@ -3037,7 +3037,7 @@ PluginGetGeometryUpdate(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg)
{
PluginGetGeometryUpdateClosure* closure =
static_cast<PluginGetGeometryUpdateClosure*>(userArg);
nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame());
nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame());
if (!f) {
NS_WARNING("Null frame in GetPluginGeometryUpdate");
return PL_DHASH_NEXT;

View File

@ -60,7 +60,7 @@ class gfxUserFontSet;
class gfxTextPerfMetrics;
class nsUserFontSet;
struct nsFontFaceRuleContainer;
class nsObjectFrame;
class nsPluginFrame;
class nsTransitionManager;
class nsAnimationManager;
class nsRefreshDriver;
@ -1445,7 +1445,7 @@ public:
* Compute geometry updates for each plugin given that aList is the display
* list for aFrame. The updates are not yet applied;
* ApplyPluginGeometryUpdates is responsible for that. In the meantime they
* are stored on each nsObjectFrame.
* are stored on each nsPluginFrame.
* This needs to be called even when aFrame is a popup, since although
* windowed plugins aren't allowed in popups, windowless plugins are
* and ComputePluginGeometryUpdates needs to be called for them.

View File

@ -103,7 +103,7 @@ FRAME_ID(nsMenuFrame)
FRAME_ID(nsMenuPopupFrame)
FRAME_ID(nsMeterFrame)
FRAME_ID(nsNumberControlFrame)
FRAME_ID(nsObjectFrame)
FRAME_ID(nsPluginFrame)
FRAME_ID(nsPageBreakFrame)
FRAME_ID(nsPageContentFrame)
FRAME_ID(nsPageFrame)

View File

@ -488,9 +488,9 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
*aMetrics, &kidReflowState, 0, 0,
NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
// XXX Some frames (e.g., nsObjectFrame, nsFrameFrame, nsTextFrame) don't bother
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother
// setting their mOverflowArea. This is wrong because every frame should
// always set mOverflowArea. In fact nsObjectFrame and nsFrameFrame don't
// always set mOverflowArea. In fact nsPluginFrame and nsFrameFrame don't
// support the 'outline' property because of this. Rather than fix the world
// right now, just fix up the overflow area if necessary. Note that we don't
// check HasOverflowRect() because it could be set even though the

View File

@ -97,7 +97,7 @@ GetObjectFrameLog()
{
static PRLogModuleInfo *sLog;
if (!sLog)
sLog = PR_NewLogModule("nsObjectFrame");
sLog = PR_NewLogModule("nsPluginFrame");
return sLog;
}
#endif /* PR_LOGGING */
@ -145,7 +145,7 @@ using namespace mozilla::layers;
class PluginBackgroundSink : public ReadbackSink {
public:
PluginBackgroundSink(nsObjectFrame* aFrame, uint64_t aStartSequenceNumber)
PluginBackgroundSink(nsPluginFrame* aFrame, uint64_t aStartSequenceNumber)
: mLastSequenceNumber(aStartSequenceNumber), mFrame(aFrame) {}
~PluginBackgroundSink()
{
@ -187,37 +187,37 @@ protected:
}
uint64_t mLastSequenceNumber;
nsObjectFrame* mFrame;
nsPluginFrame* mFrame;
};
nsObjectFrame::nsObjectFrame(nsStyleContext* aContext)
: nsObjectFrameSuper(aContext)
nsPluginFrame::nsPluginFrame(nsStyleContext* aContext)
: nsPluginFrameSuper(aContext)
, mReflowCallbackPosted(false)
{
PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG,
("Created new nsObjectFrame %p\n", this));
("Created new nsPluginFrame %p\n", this));
}
nsObjectFrame::~nsObjectFrame()
nsPluginFrame::~nsPluginFrame()
{
PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG,
("nsObjectFrame %p deleted\n", this));
("nsPluginFrame %p deleted\n", this));
}
NS_QUERYFRAME_HEAD(nsObjectFrame)
NS_QUERYFRAME_ENTRY(nsObjectFrame)
NS_QUERYFRAME_HEAD(nsPluginFrame)
NS_QUERYFRAME_ENTRY(nsPluginFrame)
NS_QUERYFRAME_ENTRY(nsIObjectFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsObjectFrameSuper)
NS_QUERYFRAME_TAIL_INHERITING(nsPluginFrameSuper)
#ifdef ACCESSIBILITY
a11y::AccType
nsObjectFrame::AccessibleType()
nsPluginFrame::AccessibleType()
{
return a11y::ePluginType;
}
#ifdef XP_WIN
NS_IMETHODIMP nsObjectFrame::GetPluginPort(HWND *aPort)
NS_IMETHODIMP nsPluginFrame::GetPluginPort(HWND *aPort)
{
*aPort = (HWND) mInstanceOwner->GetPluginPortFromWidget();
return NS_OK;
@ -226,18 +226,18 @@ NS_IMETHODIMP nsObjectFrame::GetPluginPort(HWND *aPort)
#endif
void
nsObjectFrame::Init(nsIContent* aContent,
nsPluginFrame::Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow)
{
PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG,
("Initializing nsObjectFrame %p for content %p\n", this, aContent));
("Initializing nsPluginFrame %p for content %p\n", this, aContent));
nsObjectFrameSuper::Init(aContent, aParent, aPrevInFlow);
nsPluginFrameSuper::Init(aContent, aParent, aPrevInFlow);
}
void
nsObjectFrame::DestroyFrom(nsIFrame* aDestructRoot)
nsPluginFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (mReflowCallbackPosted) {
PresContext()->PresShell()->CancelReflowCallback(this);
@ -259,11 +259,11 @@ nsObjectFrame::DestroyFrom(nsIFrame* aDestructRoot)
mBackgroundSink->Destroy();
}
nsObjectFrameSuper::DestroyFrom(aDestructRoot);
nsPluginFrameSuper::DestroyFrom(aDestructRoot);
}
/* virtual */ void
nsObjectFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
nsPluginFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
{
if (HasView()) {
nsView* view = GetView();
@ -275,25 +275,25 @@ nsObjectFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
}
}
nsObjectFrameSuper::DidSetStyleContext(aOldStyleContext);
nsPluginFrameSuper::DidSetStyleContext(aOldStyleContext);
}
nsIAtom*
nsObjectFrame::GetType() const
nsPluginFrame::GetType() const
{
return nsGkAtoms::objectFrame;
}
#ifdef DEBUG_FRAME_DUMP
nsresult
nsObjectFrame::GetFrameName(nsAString& aResult) const
nsPluginFrame::GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("ObjectFrame"), aResult);
}
#endif
nsresult
nsObjectFrame::PrepForDrawing(nsIWidget *aWidget)
nsPluginFrame::PrepForDrawing(nsIWidget *aWidget)
{
mWidget = aWidget;
@ -411,7 +411,7 @@ nsObjectFrame::PrepForDrawing(nsIWidget *aWidget)
#define EMBED_DEF_HEIGHT 200
/* virtual */ nscoord
nsObjectFrame::GetMinISize(nsRenderingContext *aRenderingContext)
nsPluginFrame::GetMinISize(nsRenderingContext *aRenderingContext)
{
nscoord result = 0;
@ -427,13 +427,13 @@ nsObjectFrame::GetMinISize(nsRenderingContext *aRenderingContext)
}
/* virtual */ nscoord
nsObjectFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
nsPluginFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
{
return nsObjectFrame::GetMinISize(aRenderingContext);
return nsPluginFrame::GetMinISize(aRenderingContext);
}
void
nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext,
nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
@ -498,12 +498,12 @@ nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext,
}
void
nsObjectFrame::Reflow(nsPresContext* aPresContext,
nsPluginFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsObjectFrame");
DO_GLOBAL_REFLOW_COUNT("nsPluginFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
// Get our desired size
@ -548,7 +548,7 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext,
///////////// nsIReflowCallback ///////////////
bool
nsObjectFrame::ReflowFinished()
nsPluginFrame::ReflowFinished()
{
mReflowCallbackPosted = false;
CallSetWindow();
@ -556,13 +556,13 @@ nsObjectFrame::ReflowFinished()
}
void
nsObjectFrame::ReflowCallbackCanceled()
nsPluginFrame::ReflowCallbackCanceled()
{
mReflowCallbackPosted = false;
}
void
nsObjectFrame::FixupWindow(const nsSize& aSize)
nsPluginFrame::FixupWindow(const nsSize& aSize)
{
nsPresContext* presContext = PresContext();
@ -613,7 +613,7 @@ nsObjectFrame::FixupWindow(const nsSize& aSize)
}
nsresult
nsObjectFrame::CallSetWindow(bool aCheckIsHidden)
nsPluginFrame::CallSetWindow(bool aCheckIsHidden)
{
NPWindow *win = nullptr;
@ -683,7 +683,7 @@ nsObjectFrame::CallSetWindow(bool aCheckIsHidden)
}
void
nsObjectFrame::RegisterPluginForGeometryUpdates()
nsPluginFrame::RegisterPluginForGeometryUpdates()
{
nsRootPresContext* rpc = PresContext()->GetRootPresContext();
NS_ASSERTION(rpc, "We should have a root pres context!");
@ -702,7 +702,7 @@ nsObjectFrame::RegisterPluginForGeometryUpdates()
}
void
nsObjectFrame::UnregisterPluginForGeometryUpdates()
nsPluginFrame::UnregisterPluginForGeometryUpdates()
{
if (!mRootPresContextRegisteredWith) {
// Not registered...
@ -713,7 +713,7 @@ nsObjectFrame::UnregisterPluginForGeometryUpdates()
}
void
nsObjectFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner)
nsPluginFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner)
{
// The ownership model here is historically fuzzy. This should only be called
// by nsPluginInstanceOwner when it is given a new frame, and
@ -743,15 +743,15 @@ nsObjectFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner)
}
bool
nsObjectFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse)
nsPluginFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse)
{
if (aTabIndex)
*aTabIndex = -1;
return nsObjectFrameSuper::IsFocusable(aTabIndex, aWithMouse);
return nsPluginFrameSuper::IsFocusable(aTabIndex, aWithMouse);
}
bool
nsObjectFrame::IsHidden(bool aCheckVisibilityStyle) const
nsPluginFrame::IsHidden(bool aCheckVisibilityStyle) const
{
if (aCheckVisibilityStyle) {
if (!StyleVisibility()->IsVisibleOrCollapsed())
@ -780,7 +780,7 @@ nsObjectFrame::IsHidden(bool aCheckVisibilityStyle) const
return false;
}
nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless)
nsIntPoint nsPluginFrame::GetWindowOriginInPixels(bool aWindowless)
{
nsView * parentWithView;
nsPoint origin(0,0);
@ -801,7 +801,7 @@ nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless)
}
void
nsObjectFrame::DidReflow(nsPresContext* aPresContext,
nsPluginFrame::DidReflow(nsPresContext* aPresContext,
const nsHTMLReflowState* aReflowState,
nsDidReflowStatus aStatus)
{
@ -814,7 +814,7 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext,
objContent->HasNewFrame(this);
}
nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus);
nsPluginFrameSuper::DidReflow(aPresContext, aReflowState, aStatus);
// The view is created hidden; once we have reflowed it and it has been
// positioned then we show it.
@ -830,7 +830,7 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext,
}
/* static */ void
nsObjectFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx,
nsPluginFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx,
const nsRect& aDirtyRect, nsPoint aPt)
{
gfxContext* ctx = aCtx->ThebesContext();
@ -845,7 +845,7 @@ nsObjectFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx,
// FIXME - Bug 385435: Doesn't aDirtyRect need translating too?
static_cast<nsObjectFrame*>(aFrame)->PrintPlugin(*aCtx, aDirtyRect);
static_cast<nsPluginFrame*>(aFrame)->PrintPlugin(*aCtx, aDirtyRect);
}
/**
@ -876,7 +876,7 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE
{
return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters);
return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters);
}
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
@ -925,7 +925,7 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE
{
return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters);
return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters);
}
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
@ -961,7 +961,7 @@ void
nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame);
bool snap;
f->PaintPlugin(aBuilder, *aCtx, mVisibleRect, GetBounds(aBuilder, &snap));
}
@ -971,7 +971,7 @@ nsDisplayPlugin::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion)
{
if (aBuilder->IsForPluginGeometry()) {
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame);
if (!aBuilder->IsInTransform() || f->IsPaintedByGecko()) {
// Since transforms induce reference frames, we don't need to worry
// about this method fluffing out due to non-rectilinear transforms.
@ -1016,7 +1016,7 @@ nsDisplayPlugin::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
{
*aSnap = false;
nsRegion result;
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame);
if (!aBuilder->IsForPluginGeometry()) {
nsIWidget* widget = f->GetWidget();
if (widget) {
@ -1045,7 +1045,7 @@ nsDisplayPlugin::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
}
nsresult
nsObjectFrame::PluginEventNotifier::Run() {
nsPluginFrame::PluginEventNotifier::Run() {
nsCOMPtr<nsIObserverService> obsSvc =
mozilla::services::GetObserverService();
obsSvc->NotifyObservers(nullptr, "plugin-changed-event", mEventType.get());
@ -1053,13 +1053,13 @@ nsObjectFrame::PluginEventNotifier::Run() {
}
void
nsObjectFrame::NotifyPluginReflowObservers()
nsPluginFrame::NotifyPluginReflowObservers()
{
nsContentUtils::AddScriptRunner(new PluginEventNotifier(NS_LITERAL_STRING("reflow")));
}
void
nsObjectFrame::DidSetWidgetGeometry()
nsPluginFrame::DidSetWidgetGeometry()
{
#if defined(XP_MACOSX)
if (mInstanceOwner) {
@ -1080,7 +1080,7 @@ nsObjectFrame::DidSetWidgetGeometry()
}
bool
nsObjectFrame::IsOpaque() const
nsPluginFrame::IsOpaque() const
{
#if defined(XP_MACOSX)
// ???
@ -1094,7 +1094,7 @@ nsObjectFrame::IsOpaque() const
}
bool
nsObjectFrame::IsTransparentMode() const
nsPluginFrame::IsTransparentMode() const
{
#if defined(XP_MACOSX)
// ???
@ -1125,7 +1125,7 @@ nsObjectFrame::IsTransparentMode() const
}
void
nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
@ -1141,7 +1141,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (type == nsPresContext::eContext_PrintPreview)
return;
DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame");
DO_GLOBAL_REFLOW_COUNT_DSP("nsPluginFrame");
#ifndef XP_MACOSX
if (mWidget && aBuilder->IsInTransform()) {
@ -1207,7 +1207,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
void
nsObjectFrame::PrintPlugin(nsRenderingContext& aRenderingContext,
nsPluginFrame::PrintPlugin(nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
nsCOMPtr<nsIObjectLoadingContent> obj(do_QueryInterface(mContent));
@ -1420,7 +1420,7 @@ nsObjectFrame::PrintPlugin(nsRenderingContext& aRenderingContext,
}
nsRect
nsObjectFrame::GetPaintedRect(nsDisplayPlugin* aItem)
nsPluginFrame::GetPaintedRect(nsDisplayPlugin* aItem)
{
if (!mInstanceOwner)
return nsRect();
@ -1436,7 +1436,7 @@ nsObjectFrame::GetPaintedRect(nsDisplayPlugin* aItem)
}
LayerState
nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
nsPluginFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager)
{
if (!mInstanceOwner)
@ -1456,7 +1456,7 @@ nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
}
already_AddRefed<Layer>
nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
nsDisplayItem* aItem,
const ContainerLayerParameters& aContainerParameters)
@ -1594,7 +1594,7 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
}
void
nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
nsRenderingContext& aRenderingContext,
const nsRect& aDirtyRect, const nsRect& aPluginRect)
{
@ -1826,7 +1826,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
}
nsresult
nsObjectFrame::HandleEvent(nsPresContext* aPresContext,
nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* anEvent,
nsEventStatus* anEventStatus)
{
@ -1869,7 +1869,7 @@ nsObjectFrame::HandleEvent(nsPresContext* aPresContext,
}
#ifdef XP_WIN
rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus);
rv = nsPluginFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus);
return rv;
#endif
@ -1893,10 +1893,10 @@ nsObjectFrame::HandleEvent(nsPresContext* aPresContext,
}
#endif
rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus);
rv = nsPluginFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus);
// We need to be careful from this point because the call to
// nsObjectFrameSuper::HandleEvent() might have killed us.
// nsPluginFrameSuper::HandleEvent() might have killed us.
#ifdef XP_MACOSX
if (anEvent->message == NS_MOUSE_BUTTON_UP) {
@ -1908,7 +1908,7 @@ nsObjectFrame::HandleEvent(nsPresContext* aPresContext,
}
nsresult
nsObjectFrame::GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance)
nsPluginFrame::GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance)
{
*aPluginInstance = nullptr;
@ -1920,7 +1920,7 @@ nsObjectFrame::GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance)
}
nsresult
nsObjectFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor)
nsPluginFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor)
{
if (!mInstanceOwner) {
return NS_ERROR_FAILURE;
@ -1937,11 +1937,11 @@ nsObjectFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor)
return NS_ERROR_FAILURE;
}
return nsObjectFrameSuper::GetCursor(aPoint, aCursor);
return nsPluginFrameSuper::GetCursor(aPoint, aCursor);
}
void
nsObjectFrame::SetIsDocumentActive(bool aIsActive)
nsPluginFrame::SetIsDocumentActive(bool aIsActive)
{
#ifndef XP_MACOSX
if (mInstanceOwner) {
@ -1952,7 +1952,7 @@ nsObjectFrame::SetIsDocumentActive(bool aIsActive)
// static
nsIObjectFrame *
nsObjectFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
nsPluginFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
{
nsIFrame* child = aRoot->GetFirstPrincipalChild();
@ -1975,7 +1975,7 @@ nsObjectFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
}
/*static*/ void
nsObjectFrame::BeginSwapDocShells(nsISupports* aSupports, void*)
nsPluginFrame::BeginSwapDocShells(nsISupports* aSupports, void*)
{
NS_PRECONDITION(aSupports, "");
nsCOMPtr<nsIContent> content(do_QueryInterface(aSupports));
@ -1984,19 +1984,19 @@ nsObjectFrame::BeginSwapDocShells(nsISupports* aSupports, void*)
}
// This function is called from a document content enumerator so we need
// to filter out the nsObjectFrames and ignore the rest.
// to filter out the nsPluginFrames and ignore the rest.
nsIObjectFrame* obj = do_QueryFrame(content->GetPrimaryFrame());
if (!obj)
return;
nsObjectFrame* objectFrame = static_cast<nsObjectFrame*>(obj);
nsPluginFrame* objectFrame = static_cast<nsPluginFrame*>(obj);
NS_ASSERTION(!objectFrame->mWidget || objectFrame->mWidget->GetParent(),
"Plugin windows must not be toplevel");
objectFrame->UnregisterPluginForGeometryUpdates();
}
/*static*/ void
nsObjectFrame::EndSwapDocShells(nsISupports* aSupports, void*)
nsPluginFrame::EndSwapDocShells(nsISupports* aSupports, void*)
{
NS_PRECONDITION(aSupports, "");
nsCOMPtr<nsIContent> content(do_QueryInterface(aSupports));
@ -2005,12 +2005,12 @@ nsObjectFrame::EndSwapDocShells(nsISupports* aSupports, void*)
}
// This function is called from a document content enumerator so we need
// to filter out the nsObjectFrames and ignore the rest.
// to filter out the nsPluginFrames and ignore the rest.
nsIObjectFrame* obj = do_QueryFrame(content->GetPrimaryFrame());
if (!obj)
return;
nsObjectFrame* objectFrame = static_cast<nsObjectFrame*>(obj);
nsPluginFrame* objectFrame = static_cast<nsPluginFrame*>(obj);
nsRootPresContext* rootPC = objectFrame->PresContext()->GetRootPresContext();
NS_ASSERTION(rootPC, "unable to register the plugin frame");
nsIWidget* widget = objectFrame->mWidget;
@ -2038,11 +2038,11 @@ nsObjectFrame::EndSwapDocShells(nsISupports* aSupports, void*)
nsIFrame*
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsObjectFrame(aContext);
return new (aPresShell) nsPluginFrame(aContext);
}
bool
nsObjectFrame::IsPaintedByGecko() const
nsPluginFrame::IsPaintedByGecko() const
{
#ifdef XP_MACOSX
return true;
@ -2051,4 +2051,4 @@ nsObjectFrame::IsPaintedByGecko() const
#endif
}
NS_IMPL_FRAMEARENA_HELPERS(nsObjectFrame)
NS_IMPL_FRAMEARENA_HELPERS(nsPluginFrame)

View File

@ -5,8 +5,8 @@
/* rendering objects for replaced elements implemented by a plugin */
#ifndef nsObjectFrame_h___
#define nsObjectFrame_h___
#ifndef nsPluginFrame_h___
#define nsPluginFrame_h___
#include "mozilla/Attributes.h"
#include "nsIObjectFrame.h"
@ -40,9 +40,9 @@ class LayerManager;
}
}
typedef nsFrame nsObjectFrameSuper;
typedef nsFrame nsPluginFrameSuper;
class nsObjectFrame : public nsObjectFrameSuper,
class nsPluginFrame : public nsPluginFrameSuper,
public nsIObjectFrame,
public nsIReflowCallback {
public:
@ -57,7 +57,7 @@ public:
friend nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_QUERYFRAME_TARGET(nsObjectFrame)
NS_DECL_QUERYFRAME_TARGET(nsPluginFrame)
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
@ -83,7 +83,7 @@ public:
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
{
return nsObjectFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
return nsPluginFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
}
virtual bool NeedsView() MOZ_OVERRIDE { return true; }
@ -183,14 +183,14 @@ public:
nsRect GetPaintedRect(nsDisplayPlugin* aItem);
/**
* If aSupports has a nsObjectFrame, then prepare it for a DocShell swap.
* If aSupports has a nsPluginFrame, then prepare it for a DocShell swap.
* @see nsSubDocumentFrame::BeginSwapDocShells.
* There will be a call to EndSwapDocShells after we were moved to the
* new view tree.
*/
static void BeginSwapDocShells(nsISupports* aSupports, void*);
/**
* If aSupports has a nsObjectFrame, then set it up after a DocShell swap.
* If aSupports has a nsPluginFrame, then set it up after a DocShell swap.
* @see nsSubDocumentFrame::EndSwapDocShells.
*/
static void EndSwapDocShells(nsISupports* aSupports, void*);
@ -211,8 +211,8 @@ public:
void SetInstanceOwner(nsPluginInstanceOwner* aOwner);
protected:
explicit nsObjectFrame(nsStyleContext* aContext);
virtual ~nsObjectFrame();
explicit nsPluginFrame(nsStyleContext* aContext);
virtual ~nsPluginFrame();
// NOTE: This frame class does not inherit from |nsLeafFrame|, so
// this is not a virtual method implementation.
@ -273,7 +273,7 @@ private:
nsCOMPtr<nsIWidget> mWidget;
nsIntRect mWindowlessRect;
/**
* This is owned by the ReadbackLayer for this nsObjectFrame. It is
* This is owned by the ReadbackLayer for this nsPluginFrame. It is
* automatically cleared if the PluginBackgroundSink is destroyed.
*/
PluginBackgroundSink* mBackgroundSink;
@ -327,7 +327,7 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE
{
return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder,
return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder,
aManager,
this,
aContainerParameters);
@ -337,9 +337,9 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE
{
return static_cast<nsObjectFrame*>(mFrame)->GetLayerState(aBuilder,
return static_cast<nsPluginFrame*>(mFrame)->GetLayerState(aBuilder,
aManager);
}
};
#endif /* nsObjectFrame_h___ */
#endif /* nsPluginFrame_h___ */

View File

@ -1021,7 +1021,7 @@ BeginSwapDocShellsForDocument(nsIDocument* aDocument, void*)
}
}
aDocument->EnumerateActivityObservers(
nsObjectFrame::BeginSwapDocShells, nullptr);
nsPluginFrame::BeginSwapDocShells, nullptr);
aDocument->EnumerateSubDocuments(BeginSwapDocShellsForDocument, nullptr);
return true;
}
@ -1118,7 +1118,7 @@ EndSwapDocShellsForDocument(nsIDocument* aDocument, void*)
}
aDocument->EnumerateActivityObservers(
nsObjectFrame::EndSwapDocShells, nullptr);
nsPluginFrame::EndSwapDocShells, nullptr);
aDocument->EnumerateSubDocuments(EndSwapDocShellsForDocument, nullptr);
return true;
}

View File

@ -240,7 +240,7 @@ NS_IMPL_ISUPPORTS(nsMathMLmactionFrame::MouseListener,
// helper to show a msg on the status bar
// curled from nsObjectFrame.cpp ...
// curled from nsPluginFrame.cpp ...
void
ShowStatus(nsPresContext* aPresContext, nsString& aStatusMsg)
{