B2G/gecko/browser/components/preferences/aboutPermissions.js
/**
   * Gets the permission value stored for a specified permission type.
   *
   * @param aType
   *        The permission type string stored in permission manager.
   *        e.g. "cookie", "geo", "indexedDB", "popup", "image"
   * @param aResultObj
   *        An object that stores the permission value set for aType.
   *
   * @return A boolean indicating whether or not a permission is set.
   */
Gets the permission value stored for a specified permission type.
@param aType
The permission type string stored in permission manager.

@return A boolean indicating whether or not a permission is set.
Gets the permission value stored for a specified permission type . @param aType The permission type string stored in permission manager . @return A boolean indicating whether or not a permission is set .
function Site_getPermission(aType, aResultObj) {
    if (aType == "password") {
      aResultObj.value =  this.loginSavingEnabled ?
                          Ci.nsIPermissionManager.ALLOW_ACTION :
                          Ci.nsIPermissionManager.DENY_ACTION;
      return true;
    }
    let permissionValue;
    if (TEST_EXACT_PERM_TYPES.indexOf(aType) == -1) {
      permissionValue = Services.perms.testPermission(this.httpURI, aType);
    } else {
      permissionValue = Services.perms.testExactPermission(this.httpURI, aType);
    }
    aResultObj.value = permissionValue;
    return permissionValue != Ci.nsIPermissionManager.UNKNOWN_ACTION;
  }
function Site_getPermission ( aType , aResultObj ) { if ( aType == "password" ) { aResultObj . value = this . loginSavingEnabled ? Ci . nsIPermissionManager . ALLOW_ACTION : Ci . nsIPermissionManager . DENY_ACTION ; return true ; } let permissionValue ; if ( TEST_EXACT_PERM_TYPES . indexOf ( aType ) == - 1 ) { permissionValue = Services . perms . testPermission ( this . httpURI , aType ) ; } else { permissionValue = Services . perms . testExactPermission ( this . httpURI , aType ) ; } aResultObj . value = permissionValue ; return permissionValue != Ci . nsIPermissionManager . UNKNOWN_ACTION ; }
Gets the permission value stored for a specified permission type.
Gets the permission value stored for a specified permission type .
// Password saving isn't a nsIPermissionManager permission type, so handle // it seperately.