--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -217,17 +217,17 @@ nsPluginInstanceOwner::GetImageContainer
// for what we do on other versions.
if (AndroidBridge::Bridge()->GetAPIVersion() < 11)
return nullptr;
LayoutDeviceRect r = GetPluginRect();
// NotifySize() causes Flash to do a bunch of stuff like ask for surfaces to render
// into, set y-flip flags, etc, so we do this at the beginning.
- gfxSize resolution = mObjectFrame->PresContext()->PresShell()->GetCumulativeResolution();
+ gfxSize resolution = mPluginFrame->PresContext()->PresShell()->GetCumulativeResolution();
ScreenSize screenSize = (r * LayoutDeviceToScreenScale(resolution.width, resolution.height)).Size();
mInstance->NotifySize(nsIntSize(screenSize.width, screenSize.height));
container = LayerManager::CreateImageContainer();
// Try to get it as an EGLImage first.
nsRefPtr<Image> img;
AttachToContainerAsEGLImage(container, mInstance, r, &img);
@@ -317,17 +317,17 @@ nsPluginInstanceOwner::nsPluginInstanceO
// struct and allows to manipulate native window procedure
nsCOMPtr<nsIPluginHost> pluginHostCOM = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
mPluginHost = static_cast<nsPluginHost*>(pluginHostCOM.get());
if (mPluginHost)
mPluginHost->NewPluginNativeWindow(&mPluginWindow);
else
mPluginWindow = nullptr;
- mObjectFrame = nullptr;
+ mPluginFrame = nullptr;
mContent = nullptr;
mWidgetCreationComplete = false;
#ifdef XP_MACOSX
memset(&mCGPluginPortCopy, 0, sizeof(NP_CGContext));
mInCGPaintLevel = 0;
mSentInitialTopLevelWindowEvent = false;
mColorProfile = nullptr;
mPluginPortChanged = false;
@@ -360,17 +360,17 @@ nsPluginInstanceOwner::~nsPluginInstance
{
if (mWaitingForPaint) {
// We don't care when the event is dispatched as long as it's "soon",
// since whoever needs it will be waiting for it.
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, true);
NS_DispatchToMainThread(event);
}
- mObjectFrame = nullptr;
+ mPluginFrame = nullptr;
PLUG_DeletePluginNativeWindow(mPluginWindow);
mPluginWindow = nullptr;
#ifdef MOZ_WIDGET_ANDROID
RemovePluginView();
#endif
@@ -538,20 +538,20 @@ NS_IMETHODIMP nsPluginInstanceOwner::Sho
return rv;
}
NS_IMETHODIMP nsPluginInstanceOwner::ShowStatus(const char16_t *aStatusMsg)
{
nsresult rv = NS_ERROR_FAILURE;
- if (!mObjectFrame) {
+ if (!mPluginFrame) {
return rv;
}
- nsCOMPtr<nsIDocShellTreeItem> docShellItem = mObjectFrame->PresContext()->GetDocShell();
+ nsCOMPtr<nsIDocShellTreeItem> docShellItem = mPluginFrame->PresContext()->GetDocShell();
if (NS_FAILED(rv) || !docShellItem) {
return rv;
}
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
rv = docShellItem->GetTreeOwner(getter_AddRefs(treeOwner));
if (NS_FAILED(rv) || !treeOwner) {
return rv;
@@ -577,25 +577,25 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get
NS_IF_ADDREF(*aDocument = mContent->OwnerDoc());
return NS_OK;
}
NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
{
// If our object frame has gone away, we won't be able to determine
// up-to-date-ness, so just fire off the event.
- if (mWaitingForPaint && (!mObjectFrame || IsUpToDate())) {
+ if (mWaitingForPaint && (!mPluginFrame || IsUpToDate())) {
// We don't care when the event is dispatched as long as it's "soon",
// since whoever needs it will be waiting for it.
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, true);
NS_DispatchToMainThread(event);
mWaitingForPaint = false;
}
- if (!mObjectFrame || !invalidRect || !mWidgetVisible)
+ if (!mPluginFrame || !invalidRect || !mWidgetVisible)
return NS_ERROR_FAILURE;
#if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID)
// Each time an asynchronously-drawing plugin sends a new surface to display,
// the image in the ImageContainer is updated and InvalidateRect is called.
// There are different side effects for (sync) Android plugins.
nsRefPtr<ImageContainer> container;
mInstance->GetImageContainer(getter_AddRefs(container));
@@ -616,44 +616,44 @@ NS_IMETHODIMP nsPluginInstanceOwner::Inv
invalidRect->right - invalidRect->left,
invalidRect->bottom - invalidRect->top);
// invalidRect is in "display pixels". In non-HiDPI modes "display pixels"
// are device pixels. But in HiDPI modes each display pixel corresponds
// to more than one device pixel.
double scaleFactor = 1.0;
GetContentsScaleFactor(&scaleFactor);
rect.ScaleRoundOut(scaleFactor);
- mObjectFrame->InvalidateLayer(nsDisplayItem::TYPE_PLUGIN, &rect);
+ mPluginFrame->InvalidateLayer(nsDisplayItem::TYPE_PLUGIN, &rect);
return NS_OK;
}
NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRegion(NPRegion invalidRegion)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPluginInstanceOwner::RedrawPlugin()
{
- if (mObjectFrame) {
- mObjectFrame->InvalidateLayer(nsDisplayItem::TYPE_PLUGIN);
+ if (mPluginFrame) {
+ mPluginFrame->InvalidateLayer(nsDisplayItem::TYPE_PLUGIN);
}
return NS_OK;
}
NS_IMETHODIMP nsPluginInstanceOwner::GetNetscapeWindow(void *value)
{
- if (!mObjectFrame) {
+ if (!mPluginFrame) {
NS_WARNING("plugin owner has no owner in getting doc's window handle");
return NS_ERROR_FAILURE;
}
#if defined(XP_WIN)
void** pvalue = (void**)value;
- nsViewManager* vm = mObjectFrame->PresContext()->GetPresShell()->GetViewManager();
+ nsViewManager* vm = mPluginFrame->PresContext()->GetPresShell()->GetViewManager();
if (!vm)
return NS_ERROR_FAILURE;
#if defined(XP_WIN)
// This property is provided to allow a "windowless" plugin to determine the window it is drawing
// in, so it can translate mouse coordinates it receives directly from the operating system
// to coordinates relative to itself.
// The original code (outside this #if) returns the document's window, which is OK if the window the "windowless" plugin
@@ -675,17 +675,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get
// unable to show a caret correctly if we return the enclosing window. Therefore for
// now we only return the enclosing window when there is an actual offset which
// would otherwise cause coordinates to be offset incorrectly. (i.e.
// if the enclosing window if offset from the document window)
//
// fixing both the caret and ability to interact issues for a windowless control in a non document aligned windw
// does not seem to be possible without a change to the flash plugin
- nsIWidget* win = mObjectFrame->GetNearestWidget();
+ nsIWidget* win = mPluginFrame->GetNearestWidget();
if (win) {
nsView *view = nsView::GetViewFor(win);
NS_ASSERTION(view, "No view for widget");
nsPoint offset = view->GetOffsetTo(nullptr);
if (offset.x || offset.y) {
// in the case the two windows are offset from eachother, we do go ahead and return the correct enclosing window
// so that mouse co-ordinates are not messed up.
@@ -703,17 +703,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get
*pvalue = (void*)widget->GetNativeData(NS_NATIVE_WINDOW);
} else {
NS_ASSERTION(widget, "couldn't get doc's widget in getting doc's window handle");
}
return NS_OK;
#elif (defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)) && defined(MOZ_X11)
// X11 window managers want the toplevel window for WM_TRANSIENT_FOR.
- nsIWidget* win = mObjectFrame->GetNearestWidget();
+ nsIWidget* win = mPluginFrame->GetNearestWidget();
if (!win)
return NS_ERROR_FAILURE;
*static_cast<Window*>(value) = (long unsigned int)win->GetNativeData(NS_NATIVE_SHAREABLE_WINDOW);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
@@ -1122,18 +1122,18 @@ GetOffsetRootContent(nsIFrame* aFrame)
offset += docOffset.ConvertAppUnits(currAPD, apd);
return offset;
}
LayoutDeviceRect nsPluginInstanceOwner::GetPluginRect()
{
// Get the offset of the content relative to the page
- nsRect bounds = mObjectFrame->GetContentRectRelativeToSelf() + GetOffsetRootContent(mObjectFrame);
- LayoutDeviceIntRect rect = LayoutDeviceIntRect::FromAppUnitsToNearest(bounds, mObjectFrame->PresContext()->AppUnitsPerDevPixel());
+ nsRect bounds = mPluginFrame->GetContentRectRelativeToSelf() + GetOffsetRootContent(mPluginFrame);
+ LayoutDeviceIntRect rect = LayoutDeviceIntRect::FromAppUnitsToNearest(bounds, mPluginFrame->PresContext()->AppUnitsPerDevPixel());
return LayoutDeviceRect(rect);
}
bool nsPluginInstanceOwner::AddPluginView(const LayoutDeviceRect& aRect /* = LayoutDeviceRect(0, 0, 0, 0) */)
{
if (!mJavaView) {
mJavaView = mInstance->GetJavaSurface();
@@ -1345,17 +1345,17 @@ nsPluginInstanceOwner::ProcessMouseDown(
#if !defined(XP_MACOSX)
if (!mPluginWindow || (mPluginWindow->type == NPWindowTypeWindow))
return aMouseEvent->PreventDefault(); // consume event
// continue only for cases without child window
#endif
// if the plugin is windowless, we need to set focus ourselves
// otherwise, we might not get key events
- if (mObjectFrame && mPluginWindow &&
+ if (mPluginFrame && mPluginWindow &&
mPluginWindow->type == NPWindowTypeDrawable) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(mContent);
fm->SetFocus(elem, 0);
}
}
@@ -1477,17 +1477,17 @@ static unsigned int XInputEventState(con
return state;
}
#endif
nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
{
nsEventStatus rv = nsEventStatus_eIgnore;
- if (!mInstance || !mObjectFrame) // if mInstance is null, we shouldn't be here
+ if (!mInstance || !mPluginFrame) // if mInstance is null, we shouldn't be here
return nsEventStatus_eIgnore;
#ifdef XP_MACOSX
if (!mWidget)
return nsEventStatus_eIgnore;
// we never care about synthesized mouse enter
if (anEvent.message == NS_MOUSE_ENTER_SYNTH)
@@ -1498,37 +1498,37 @@ nsEventStatus nsPluginInstanceOwner::Pro
return nsEventStatus_eIgnore;
NPEventModel eventModel = GetEventModel();
// If we have to synthesize an event we'll use one of these.
NPCocoaEvent synthCocoaEvent;
const NPCocoaEvent* event = static_cast<const NPCocoaEvent*>(anEvent.mPluginEvent);
nsPoint pt =
- nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mObjectFrame) -
- mObjectFrame->GetContentRectRelativeToSelf().TopLeft();
- nsPresContext* presContext = mObjectFrame->PresContext();
+ nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
+ mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
+ nsPresContext* presContext = mPluginFrame->PresContext();
// Plugin event coordinates need to be translated from device pixels
// into "display pixels" in HiDPI modes.
double scaleFactor = 1.0;
GetContentsScaleFactor(&scaleFactor);
size_t intScaleFactor = ceil(scaleFactor);
nsIntPoint ptPx(presContext->AppUnitsToDevPixels(pt.x) / intScaleFactor,
presContext->AppUnitsToDevPixels(pt.y) / intScaleFactor);
if (!event) {
InitializeNPCocoaEvent(&synthCocoaEvent);
switch (anEvent.message) {
case NS_MOUSE_MOVE:
{
// Ignore mouse-moved events that happen as part of a dragging
// operation that started over another frame. See bug 525078.
- nsRefPtr<nsFrameSelection> frameselection = mObjectFrame->GetFrameSelection();
+ nsRefPtr<nsFrameSelection> frameselection = mPluginFrame->GetFrameSelection();
if (!frameselection->GetDragState() ||
- (nsIPresShell::GetCapturingContent() == mObjectFrame->GetContent())) {
+ (nsIPresShell::GetCapturingContent() == mPluginFrame->GetContent())) {
synthCocoaEvent.type = NPCocoaEventMouseMoved;
synthCocoaEvent.data.mouse.pluginX = static_cast<double>(ptPx.x);
synthCocoaEvent.data.mouse.pluginY = static_cast<double>(ptPx.y);
event = &synthCocoaEvent;
}
}
break;
case NS_MOUSE_BUTTON_DOWN:
@@ -1537,17 +1537,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
synthCocoaEvent.data.mouse.pluginY = static_cast<double>(ptPx.y);
event = &synthCocoaEvent;
break;
case NS_MOUSE_BUTTON_UP:
// If we're in a dragging operation that started over another frame,
// convert it into a mouse-entered event (in the Cocoa Event Model).
// See bug 525078.
if (anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
- (nsIPresShell::GetCapturingContent() != mObjectFrame->GetContent())) {
+ (nsIPresShell::GetCapturingContent() != mPluginFrame->GetContent())) {
synthCocoaEvent.type = NPCocoaEventMouseEntered;
synthCocoaEvent.data.mouse.pluginX = static_cast<double>(ptPx.x);
synthCocoaEvent.data.mouse.pluginY = static_cast<double>(ptPx.y);
event = &synthCocoaEvent;
} else {
synthCocoaEvent.type = NPCocoaEventMouseUp;
synthCocoaEvent.data.mouse.pluginX = static_cast<double>(ptPx.x);
synthCocoaEvent.data.mouse.pluginY = static_cast<double>(ptPx.y);
@@ -1647,22 +1647,22 @@ nsEventStatus nsPluginInstanceOwner::Pro
NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN ||
anEvent.message == NS_MOUSE_BUTTON_UP ||
anEvent.message == NS_MOUSE_DOUBLECLICK ||
anEvent.message == NS_MOUSE_ENTER_SYNTH ||
anEvent.message == NS_MOUSE_EXIT_SYNTH ||
anEvent.message == NS_MOUSE_MOVE,
"Incorrect event type for coordinate translation");
nsPoint pt =
- nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mObjectFrame) -
- mObjectFrame->GetContentRectRelativeToSelf().TopLeft();
- nsPresContext* presContext = mObjectFrame->PresContext();
+ nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
+ mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
+ nsPresContext* presContext = mPluginFrame->PresContext();
nsIntPoint ptPx(presContext->AppUnitsToDevPixels(pt.x),
presContext->AppUnitsToDevPixels(pt.y));
- nsIntPoint widgetPtPx = ptPx + mObjectFrame->GetWindowOriginInPixels(true);
+ nsIntPoint widgetPtPx = ptPx + mPluginFrame->GetWindowOriginInPixels(true);
const_cast<NPEvent*>(pPluginEvent)->lParam = MAKELPARAM(widgetPtPx.x, widgetPtPx.y);
}
}
else if (!pPluginEvent) {
switch (anEvent.message) {
case NS_FOCUS_CONTENT:
pluginEvent.event = WM_SETFOCUS;
pluginEvent.wParam = 0;
@@ -1707,20 +1707,20 @@ nsEventStatus nsPluginInstanceOwner::Pro
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
// Button up/down events sent instead.
return rv;
}
// Get reference point relative to plugin origin.
- const nsPresContext* presContext = mObjectFrame->PresContext();
+ const nsPresContext* presContext = mPluginFrame->PresContext();
nsPoint appPoint =
- nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mObjectFrame) -
- mObjectFrame->GetContentRectRelativeToSelf().TopLeft();
+ nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
+ mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
presContext->AppUnitsToDevPixels(appPoint.y));
const WidgetMouseEvent& mouseEvent = *anEvent.AsMouseEvent();
// Get reference point relative to screen:
LayoutDeviceIntPoint rootPoint(-1, -1);
if (widget)
rootPoint = anEvent.refPoint +
LayoutDeviceIntPoint::FromUntyped(widget->WidgetToScreenOffset());
@@ -1908,20 +1908,20 @@ nsEventStatus nsPluginInstanceOwner::Pro
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
// Button up/down events sent instead.
return rv;
}
// Get reference point relative to plugin origin.
- const nsPresContext* presContext = mObjectFrame->PresContext();
+ const nsPresContext* presContext = mPluginFrame->PresContext();
nsPoint appPoint =
- nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mObjectFrame) -
- mObjectFrame->GetContentRectRelativeToSelf().TopLeft();
+ nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
+ mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
presContext->AppUnitsToDevPixels(appPoint.y));
switch (anEvent.message)
{
case NS_MOUSE_MOVE:
{
// are these going to be touch events?
@@ -2040,17 +2040,17 @@ nsPluginInstanceOwner::Destroy()
return NS_OK;
}
// Paints are handled differently, so we just simulate an update event.
#ifdef XP_MACOSX
void nsPluginInstanceOwner::Paint(const gfxRect& aDirtyRect, CGContextRef cgContext)
{
- if (!mInstance || !mObjectFrame)
+ if (!mInstance || !mPluginFrame)
return;
gfxRect dirtyRectCopy = aDirtyRect;
double scaleFactor = 1.0;
GetContentsScaleFactor(&scaleFactor);
if (scaleFactor != 1.0) {
::CGContextScaleCTM(cgContext, scaleFactor, scaleFactor);
// Convert aDirtyRect from device pixels to "display pixels"
@@ -2062,17 +2062,17 @@ void nsPluginInstanceOwner::Paint(const
if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin())) {
DoCocoaEventDrawRect(dirtyRectCopy, cgContext);
pluginWidget->EndDrawPlugin();
}
}
void nsPluginInstanceOwner::DoCocoaEventDrawRect(const gfxRect& aDrawRect, CGContextRef cgContext)
{
- if (!mInstance || !mObjectFrame)
+ if (!mInstance || !mPluginFrame)
return;
// The context given here is only valid during the HandleEvent call.
NPCocoaEvent updateEvent;
InitializeNPCocoaEvent(&updateEvent);
updateEvent.type = NPCocoaEventDrawRect;
updateEvent.data.draw.context = cgContext;
updateEvent.data.draw.x = aDrawRect.X();
@@ -2082,34 +2082,34 @@ void nsPluginInstanceOwner::DoCocoaEvent
mInstance->HandleEvent(&updateEvent, nullptr);
}
#endif
#ifdef XP_WIN
void nsPluginInstanceOwner::Paint(const RECT& aDirty, HDC aDC)
{
- if (!mInstance || !mObjectFrame)
+ if (!mInstance || !mPluginFrame)
return;
NPEvent pluginEvent;
pluginEvent.event = WM_PAINT;
pluginEvent.wParam = WPARAM(aDC);
pluginEvent.lParam = LPARAM(&aDirty);
mInstance->HandleEvent(&pluginEvent, nullptr);
}
#endif
#ifdef MOZ_WIDGET_ANDROID
void nsPluginInstanceOwner::Paint(gfxContext* aContext,
const gfxRect& aFrameRect,
const gfxRect& aDirtyRect)
{
- if (!mInstance || !mObjectFrame || !mPluginDocumentActiveState || mFullScreen)
+ if (!mInstance || !mPluginFrame || !mPluginDocumentActiveState || mFullScreen)
return;
int32_t model = mInstance->GetANPDrawingModel();
if (model == kSurface_ANPDrawingModel) {
if (!AddPluginView(GetPluginRect())) {
Invalidate();
}
@@ -2164,17 +2164,17 @@ void nsPluginInstanceOwner::Paint(gfxCon
}
#endif
#if defined(MOZ_X11)
void nsPluginInstanceOwner::Paint(gfxContext* aContext,
const gfxRect& aFrameRect,
const gfxRect& aDirtyRect)
{
- if (!mInstance || !mObjectFrame)
+ if (!mInstance || !mPluginFrame)
return;
// to provide crisper and faster drawing.
gfxRect pluginRect = aFrameRect;
if (aContext->UserToDevicePixelSnapped(pluginRect)) {
pluginRect = aContext->DeviceToUser(pluginRect);
}
@@ -2519,19 +2519,19 @@ NS_IMETHODIMP nsPluginInstanceOwner::Cre
pluginWidget->SetPluginDrawingModel(GetDrawingModel());
if (GetDrawingModel() == NPDrawingModelCoreAnimation) {
AddToCARefreshTimer();
}
#endif
}
- if (mObjectFrame) {
+ if (mPluginFrame) {
// nullptr widget is fine, will result in windowless setup.
- mObjectFrame->PrepForDrawing(mWidget);
+ mPluginFrame->PrepForDrawing(mWidget);
}
if (windowless) {
mPluginWindow->type = NPWindowTypeDrawable;
// this needs to be a HDC according to the spec, but I do
// not see the right way to release it so let's postpone
// passing HDC till paint event when it is really
@@ -2568,31 +2568,31 @@ NS_IMETHODIMP nsPluginInstanceOwner::Cre
return NS_OK;
}
// Mac specific code to fix up the port location and clipping region
#ifdef XP_MACOSX
void* nsPluginInstanceOwner::FixUpPluginWindow(int32_t inPaintState)
{
- if (!mWidget || !mPluginWindow || !mInstance || !mObjectFrame)
+ if (!mWidget || !mPluginWindow || !mInstance || !mPluginFrame)
return nullptr;
nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);
if (!pluginWidget)
return nullptr;
// 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();
}
// We'll need the top-level Cocoa window for the Cocoa event model.
- nsIWidget* widget = mObjectFrame->GetNearestWidget();
+ nsIWidget* widget = mPluginFrame->GetNearestWidget();
if (!widget)
return nullptr;
void *cocoaTopLevelWindow = widget->GetNativeData(NS_NATIVE_WINDOW);
// We don't expect to have a top level window in a content process
if (!cocoaTopLevelWindow && XRE_GetProcessType() == GeckoProcessType_Default) {
return nullptr;
}
@@ -2717,17 +2717,17 @@ void nsPluginInstanceOwner::UpdateWindow
// passed to the plugin during paint, an additional update
// of the the clip rectangle here is not required
if (aSetWindow && !mWidget && mPluginWindowVisible && !UseAsyncRendering())
return;
const NPWindow oldWindow = *mPluginWindow;
bool windowless = (mPluginWindow->type == NPWindowTypeDrawable);
- nsIntPoint origin = mObjectFrame->GetWindowOriginInPixels(windowless);
+ nsIntPoint origin = mPluginFrame->GetWindowOriginInPixels(windowless);
mPluginWindow->x = origin.x;
mPluginWindow->y = origin.y;
mPluginWindow->clipRect.left = 0;
mPluginWindow->clipRect.top = 0;
if (mPluginWindowVisible && mPluginDocumentActiveState) {
@@ -2781,18 +2781,18 @@ nsPluginInstanceOwner::UpdateDocumentAct
}
#endif
}
#endif // XP_MACOSX
NS_IMETHODIMP
nsPluginInstanceOwner::CallSetWindow()
{
- if (mObjectFrame) {
- mObjectFrame->CallSetWindow(false);
+ if (mPluginFrame) {
+ mPluginFrame->CallSetWindow(false);
} else if (mInstance) {
if (UseAsyncRendering()) {
mInstance->AsyncSetWindow(mPluginWindow);
} else {
mInstance->SetWindow(mPluginWindow);
}
}
@@ -2816,51 +2816,51 @@ nsPluginInstanceOwner::GetContentsScaleF
#endif
*result = scaleFactor;
return NS_OK;
}
void nsPluginInstanceOwner::SetFrame(nsPluginFrame *aFrame)
{
// Don't do anything if the frame situation hasn't changed.
- if (mObjectFrame == aFrame) {
+ if (mPluginFrame == aFrame) {
return;
}
// If we already have a frame that is changing or going away...
- if (mObjectFrame) {
+ if (mPluginFrame) {
// Make sure the old frame isn't holding a reference to us.
- mObjectFrame->SetInstanceOwner(nullptr);
+ mPluginFrame->SetInstanceOwner(nullptr);
}
// Swap in the new frame (or no frame)
- mObjectFrame = aFrame;
+ mPluginFrame = aFrame;
// Set up a new frame
- if (mObjectFrame) {
- mObjectFrame->SetInstanceOwner(this);
+ if (mPluginFrame) {
+ mPluginFrame->SetInstanceOwner(this);
// Can only call PrepForDrawing on an object frame once. Don't do it here unless
// widget creation is complete. Doesn't matter if we actually have a widget.
if (mWidgetCreationComplete) {
- mObjectFrame->PrepForDrawing(mWidget);
+ mPluginFrame->PrepForDrawing(mWidget);
}
- mObjectFrame->FixupWindow(mObjectFrame->GetContentRectRelativeToSelf().Size());
- mObjectFrame->InvalidateFrame();
+ mPluginFrame->FixupWindow(mPluginFrame->GetContentRectRelativeToSelf().Size());
+ mPluginFrame->InvalidateFrame();
nsFocusManager* fm = nsFocusManager::GetFocusManager();
const nsIContent* content = aFrame->GetContent();
if (fm && content) {
mContentFocused = (content == fm->GetFocusedContent());
}
}
}
nsPluginFrame* nsPluginInstanceOwner::GetFrame()
{
- return mObjectFrame;
+ return mPluginFrame;
}
NS_IMETHODIMP nsPluginInstanceOwner::PrivateModeChanged(bool aEnabled)
{
return mInstance ? mInstance->PrivateModeStateChanged(aEnabled) : NS_OK;
}
already_AddRefed<nsIURI> nsPluginInstanceOwner::GetBaseURI() const