case NS_XUL_CLOSE:
HandleBrowserEvent(nsGUIEvent *aEvent){   nsEventStatus result = nsEventStatus_eIgnore;  nsBrowserWindow* bw =    nsBrowserWindow::FindBrowserFor(aEvent->widget, FIND_WINDOW);  if (nsnull != bw) {    nsSizeEvent* sizeEvent;    switch(aEvent->message) {    case NS_SIZE:      sizeEvent = (nsSizeEvent*)aEvent;        bw->Layout(sizeEvent->windowSize->width,                 sizeEvent->windowSize->height);      result = nsEventStatus_eConsumeNoDefault;      break;    case NS_DESTROY:    {      nsViewerApp* app = bw->mApp;      app->CloseWindow(bw);      result = nsEventStatus_eConsumeDoDefault;#ifndef XP_MAC      // XXX Really shouldn't just exit, we should just notify somebody...      if (0 == nsBrowserWindow::gBrowsers.Count()) {        app->Exit();      }#endif    }    return result;    case NS_MENU_SELECTED:      result = bw->DispatchMenuItem(((nsMenuEvent*)aEvent)->mCommand);      break;    default:      break;    }    NS_RELEASE(bw);  }  return result;}