nsIView* view = nsnull; GetView(aPresContext, &view); if (view) { nsCOMPtr<nsIViewManager> vm; view->GetViewManager(*getter_AddRefs(vm)); if (vm) vm->SetViewVisibility(view, nsViewVisibility_kShow);
if (nsnull != mInstanceOwner) { nsPluginWindow    *window;  if (NS_OK == mInstanceOwner->GetWindow(window)) { nsIView           *parentWithView; nsPoint           origin; nsIPluginInstance *inst; float             t2p; aPresContext->GetTwipsToPixels(&t2p); nscoord           offx, offy;  GetOffsetFromView(aPresContext, origin, &parentWithView);  #if 0  parentWithView->GetScrollOffset(&offx, &offy); #else offx = offy = 0; #endif  window->x = NSTwipsToIntPixels(origin.x, t2p); window->y = NSTwipsToIntPixels(origin.y, t2p);     window->window = mInstanceOwner->GetPluginPort();    #ifdef XP_MAC nsPluginPort* port = window->window; nsPluginRect& clipRect = window->clipRect; clipRect.top = -port->porty; clipRect.left = -port->portx; clipRect.bottom = clipRect.top + window->height; clipRect.right = clipRect.left + window->width; #else  window->clipRect.top = 0; window->clipRect.left = 0; window->clipRect.bottom = window->clipRect.top + window->height; window->clipRect.right = window->clipRect.left + window->width; #endif  if (NS_OK == mInstanceOwner->GetInstance(inst)) { inst->SetWindow(window); NS_RELEASE(inst); }   mInstanceOwner->ReleasePluginPort((nsPluginPort *)window->window);  if (mWidget) { PRInt32 x = NSTwipsToIntPixels(origin.x, t2p); PRInt32 y = NSTwipsToIntPixels(origin.y, t2p); mWidget->Move(x, y); } } }
nsObjectFrame::DidReflow(nsIPresContext*           aPresContext,                         const nsHTMLReflowState*  aReflowState,                         nsDidReflowStatus         aStatus){  nsresult rv = nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus);  // The view is created hidden; once we have reflowed it and it has been  // positioned then we show it.  if ((aStatus != NS_FRAME_REFLOW_FINISHED) || IsHidden())     return rv;  nsIView* view = nsnull;  GetView(aPresContext, &view);  if (view) {    nsCOMPtr<nsIViewManager> vm;    view->GetViewManager(*getter_AddRefs(vm));    if (vm)      vm->SetViewVisibility(view, nsViewVisibility_kShow);  }  nsPluginWindow *window;  if (!mInstanceOwner || NS_FAILED(mInstanceOwner->GetWindow(window)))    return rv;  PRBool windowless = (window->type == nsPluginWindowType_Drawable);  // if we are on Mac or windowless on Windows we will get Paint   // event anyway so there is no need to update plugin window  // and call NPP_SetWindow here, it'll be done in Paint.  // Windowed plugins thought need it to be done here, there will  // no chance to do it later because they will get paint event  // from the OS itself#ifdef XP_MAC  return rv;#endif // XP_MAC  if(windowless)    return rv;  nsPoint origin;  GetWindowOriginInPixels(aPresContext, windowless, &origin);  window->x = origin.x;  window->y = origin.y;  // refresh the plugin port as well  window->window = mInstanceOwner->GetPluginPort();  nsIPluginInstance *inst;  if (NS_OK == mInstanceOwner->GetInstance(inst)) {    inst->SetWindow(window);    NS_RELEASE(inst);  }  mInstanceOwner->ReleasePluginPort((nsPluginPort *)window->window);  if (mWidget) {    PRInt32 x = origin.x;    PRInt32 y = origin.y;    mWidget->Move(x, y);  }  return rv;}