nsIFrame* parWithView; nsIView *parView;
mInstance->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,                            nscoord aWidth,                            nscoord aHeight,                            PRBool aViewOnly){  nsIView* view;  // Create our view and widget  nsresult result =     nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,                                 (void **)&view);  if (NS_OK != result) {    return result;  }  nsIViewManager *viewMan;    // need to release  nsRect boundBox(0, 0, aWidth, aHeight);   nsIFrame* parWithView;  nsIView *parView;  GetParentWithView(aPresContext, &parWithView);  parWithView->GetView(aPresContext, &parView);  if (NS_OK == parView->GetViewManager(viewMan))  {  //  nsWidgetInitData* initData = GetWidgetInitData(aPresContext); // needs to be deleted    // initialize the view as hidden since we don't know the (x,y) until Paint    result = view->Init(viewMan, boundBox, parView, nsnull,                        nsViewVisibility_kHide);  //  if (nsnull != initData) {  //    delete(initData);  //  }    if (NS_OK != result) {      result = NS_OK;       //XXX why OK? MMP      goto exit;            //XXX sue me. MMP    }#if 0    // set the content's widget, so it can get content modified by the widget    nsIWidget *widget;    result = GetWidget(view, &widget);    if (NS_OK == result) {      nsInput* content = (nsInput *)mContent; // change this cast to QueryInterface       content->SetWidget(widget);      NS_IF_RELEASE(widget);    } else {      NS_ASSERTION(0, "could not get widget");    }#endif    viewMan->InsertChild(parView, view, 0);    result = view->CreateWidget(kWidgetCID);    if (NS_OK != result) {      result = NS_OK;       //XXX why OK? MMP      goto exit;            //XXX sue me. MMP    }  }  {    //this is ugly. it was ripped off from didreflow(). MMP    // Position and size view relative to its parent, not relative to our    // parent frame (our parent frame may not have a view).    nsIView* parentWithView;    nsPoint origin;    view->SetVisibility(nsViewVisibility_kShow);    GetOffsetFromView(aPresContext, origin, &parentWithView);    viewMan->ResizeView(view, mRect.width, mRect.height);    viewMan->MoveViewTo(view, origin.x, origin.y);  }  SetView(aPresContext, view);exit:  NS_IF_RELEASE(viewMan);    return result;}