rv = mViewManager->Init(dx, tbounds.x, tbounds.y);
rv = mViewManager->Init(dx); if (NS_FAILED(rv)) return rv; rv = mViewManager->SetWindowOffset(tbounds.x, tbounds.y);
DocumentViewerImpl::MakeWindow(nsIWidget* aParentWidget,                               const nsRect& aBounds){  nsresult rv;  mViewManager = do_CreateInstance(kViewManagerCID, &rv);  if (NS_FAILED(rv))    return rv;  nsCOMPtr<nsIDeviceContext> dx;  mPresContext->GetDeviceContext(getter_AddRefs(dx));   nsRect tbounds = aBounds;  float p2t;  mPresContext->GetPixelsToTwips(&p2t);  tbounds *= p2t;   // Initialize the view manager with an offset. This allows the viewmanager   // to manage a coordinate space offset from (0,0)  rv = mViewManager->Init(dx, tbounds.x, tbounds.y);  if (NS_FAILED(rv))    return rv;   // Reset the bounds offset so the root view is set to 0,0. The offset is   // specified in nsIViewManager::Init above.    // Besides, layout will reset the root view to (0,0) during reflow,    // so changing it to 0,0 eliminates placing   // the root view in the wrong place initially.  tbounds.x = 0;  tbounds.y = 0;  // Create a child window of the parent that is our "root view/window"  // Create a view  rv = CallCreateInstance(kViewCID, &mView);  if (NS_FAILED(rv))    return rv;  rv = mView->Init(mViewManager, tbounds, nsnull);  if (NS_FAILED(rv))    return rv;  rv = mView->CreateWidget(kWidgetCID, nsnull,                           aParentWidget->GetNativeData(NS_NATIVE_WIDGET),                           PR_TRUE, PR_FALSE);  if (rv != NS_OK)    return rv;  // Setup hierarchical relationship in view manager  mViewManager->SetRootView(mView);  mView->GetWidget(*getter_AddRefs(mWindow));  // This SetFocus is necessary so the Arrow Key and Page Key events  // go to the scrolled view as soon as the Window is created instead of going to  // the browser window (this enables keyboard scrolling of the document)  // mWindow->SetFocus();  return rv;}