B2G/gecko/accessible/tests/mochitest/autocomplete.js
/**
 * Register the given AutoCompleteSearch.
 *
 * @param aSearch       [in] AutoCompleteSearch object
 * @param aDescription  [in] description of the search object
 */
Register the given AutoCompleteSearch.
@param aSearch       [in] AutoCompleteSearch object
@param aDescription  [in] description of the search object
Register the given AutoCompleteSearch . @param aSearch [ in ] AutoCompleteSearch object @param aDescription [ in ] description of the search object
function registerAutoCompleteSearch(aSearch, aDescription)
{
  var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
  var uuidGenerator = Components.classes["@mozilla.org/uuid-generator;1"].
    getService(nsIUUIDGenerator);
  var cid = uuidGenerator.generateUUID();
  var componentManager = Components.manager.QueryInterface(nsIComponentRegistrar);
  componentManager.registerFactory(cid, aDescription, name, aSearch);
  aSearch.cid = cid;
}
function registerAutoCompleteSearch ( aSearch , aDescription ) { var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch . name ; var uuidGenerator = Components . classes [ "@mozilla.org/uuid-generator;1" ] . getService ( nsIUUIDGenerator ) ; var cid = uuidGenerator . generateUUID ( ) ; var componentManager = Components . manager . QueryInterface ( nsIComponentRegistrar ) ; componentManager . registerFactory ( cid , aDescription , name , aSearch ) ; aSearch . cid = cid ; }
Register the given AutoCompleteSearch.
Register the given AutoCompleteSearch .
// Keep the id on the object so we can unregister later.