B2G/gecko/browser/components/feeds/src/WebContentConverter.js
/**
   * Register a web service handler for a content type.
   * 
   * @param   contentType
   *          the content type being handled
   * @param   uri
   *          the URI of the web service
   * @param   title
   *          the human readable name of the web service
   */
Register a web service handler for a content type.

@param   contentType
the content type being handled
@param   uri
the URI of the web service
@param   title
the human readable name of the web service
Register a web service handler for a content type . @param contentType the content type being handled @param uri the URI of the web service @param title the human readable name of the web service
function WCCR__registerContentHandler(contentType, uri, title) {
    this._updateContentTypeHandlerMap(contentType, uri, title);
    this._saveContentHandlerToPrefs(contentType, uri, title);
    if (contentType == TYPE_MAYBE_FEED) {
      var pb = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefService).getBranch(null);
      pb.setCharPref(PREF_SELECTED_READER, "web");
      var supportsString = 
        Cc["@mozilla.org/supports-string;1"].
        createInstance(Ci.nsISupportsString);
        supportsString.data = uri;
      pb.setComplexValue(PREF_SELECTED_WEB, Ci.nsISupportsString,
                         supportsString);
      pb.setCharPref(PREF_SELECTED_ACTION, "ask");
      this._setAutoHandler(TYPE_MAYBE_FEED, null);
    }
  }
function WCCR__registerContentHandler ( contentType , uri , title ) { this . _updateContentTypeHandlerMap ( contentType , uri , title ) ; this . _saveContentHandlerToPrefs ( contentType , uri , title ) ; if ( contentType == TYPE_MAYBE_FEED ) { var pb = Cc [ "@mozilla.org/preferences-service;1" ] . getService ( Ci . nsIPrefService ) . getBranch ( null ) ; pb . setCharPref ( PREF_SELECTED_READER , "web" ) ; var supportsString = Cc [ "@mozilla.org/supports-string;1" ] . createInstance ( Ci . nsISupportsString ) ; supportsString . data = uri ; pb . setComplexValue ( PREF_SELECTED_WEB , Ci . nsISupportsString , supportsString ) ; pb . setCharPref ( PREF_SELECTED_ACTION , "ask" ) ; this . _setAutoHandler ( TYPE_MAYBE_FEED , null ) ; } }
Register a web service handler for a content type.
Register a web service handler for a content type .
// Make the new handler the last-selected reader in the preview page // and make sure the preview page is shown the next time a feed is visited