case XULCOMMANDDISPATCHER_SUPPRESSFOCUS: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUS, PR_FALSE); if (NS_SUCCEEDED(rv)) { PRBool prop; rv = a->GetSuppressFocus(&prop); if (NS_SUCCEEDED(rv)) { *vp = BOOLEAN_TO_JSVAL(prop); } } break; } case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_FALSE); if (NS_SUCCEEDED(rv)) { PRBool prop; rv = a->GetSuppressFocusScroll(&prop); if (NS_SUCCEEDED(rv)) { *vp = BOOLEAN_TO_JSVAL(prop); } } break; } case XULCOMMANDDISPATCHER_ACTIVE: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_FALSE); if (NS_SUCCEEDED(rv)) { PRBool prop; rv = a->GetActive(&prop); if (NS_SUCCEEDED(rv)) { *vp = BOOLEAN_TO_JSVAL(prop); } } break; }
GetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){  nsIDOMXULCommandDispatcher *a = (nsIDOMXULCommandDispatcher*)nsJSUtils::nsGetNativeThis(cx, obj);  // If there's no private data, this must be the prototype, so ignore  if (nsnull == a) {    return JS_TRUE;  }  nsresult rv = NS_OK;  if (JSVAL_IS_INT(id)) {    nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj);    if (!secMan)        return PR_FALSE;    switch(JSVAL_TO_INT(id)) {      case XULCOMMANDDISPATCHER_FOCUSEDELEMENT:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDELEMENT, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsIDOMElement* prop;          rv = a->GetFocusedElement(&prop);          if (NS_SUCCEEDED(rv)) {            // get the js object            nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);          }        }        break;      }      case XULCOMMANDDISPATCHER_FOCUSEDWINDOW:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDWINDOW, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsIDOMWindowInternal* prop;          rv = a->GetFocusedWindow(&prop);          if (NS_SUCCEEDED(rv)) {            // get the js object            nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);          }        }        break;      }      case XULCOMMANDDISPATCHER_SUPPRESSFOCUS:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUS, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRBool prop;          rv = a->GetSuppressFocus(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = BOOLEAN_TO_JSVAL(prop);          }        }        break;      }      case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRBool prop;          rv = a->GetSuppressFocusScroll(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = BOOLEAN_TO_JSVAL(prop);          }        }        break;      }      case XULCOMMANDDISPATCHER_ACTIVE:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRBool prop;          rv = a->GetActive(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = BOOLEAN_TO_JSVAL(prop);          }        }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);    }  }  else {    return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);  }  if (NS_FAILED(rv))      return nsJSUtils::nsReportError(cx, obj, rv);  return PR_TRUE;}