B2G/gecko/browser/components/feeds/src/WebContentConverter.js
/**
   * Appends a notifcation for the given feed reader details.
   *
   * The notification could be either a pseudo-dialog which lets
   * the user to add the feed reader:
   * [ [icon] Add %feed-reader-name% (%feed-reader-host%) as a Feed Reader?  (Add) [x] ]
   *
   * or a simple message for the case where the feed reader is already registered:
   * [ [icon] %feed-reader-name% is already registered as a Feed Reader             [x] ]
   *
   * A new notification isn't appended if the given notificationbox has a
   * notification for the same feed reader.
   *
   * @param aURI
   *        The url of the feed reader as a nsIURI object
   * @param aName
   *        The feed reader name as it was passed to registerContentHandler
   * @param aNotificationBox
   *        The notification box to which a notification might be appended
   * @return true if a notification has been appended, false otherwise.
   */
Appends a notifcation for the given feed reader details.

or a simple message for the case where the feed reader is already registered:
[ [icon] %feed-reader-name% is already registered as a Feed Reader             [x] ]

A new notification isn't appended if the given notificationbox has a
notification for the same feed reader.

@param aURI
The url of the feed reader as a nsIURI object
@param aName
The feed reader name as it was passed to registerContentHandler
@param aNotificationBox
The notification box to which a notification might be appended
@return true if a notification has been appended, false otherwise.
Appends a notifcation for the given feed reader details . or a simple message for the case where the feed reader is already registered : [ [ icon ] %feed - reader - name% is already registered as a Feed Reader [ x ] ] A new notification isn ' t appended if the given notificationbox has a notification for the same feed reader . @param aURI The url of the feed reader as a nsIURI object @param aName The feed reader name as it was passed to registerContentHandler @param aNotificationBox The notification box to which a notification might be appended @return true if a notification has been appended false otherwise .
function WCCR__appendFeedReaderNotification(aURI, aName, aNotificationBox) {
    var uriSpec = aURI.spec;
    var notificationValue = "feed reader notification: " + uriSpec;
    var notificationIcon = aURI.prePath + "/favicon.ico";
    if (aNotificationBox.getNotificationWithValue(notificationValue))
      return false;
    var buttons, message;
    if (this.getWebContentHandlerByURI(TYPE_MAYBE_FEED, uriSpec))
      message = this._getFormattedString("handlerRegistered", [aName]);
    else {
      message = this._getFormattedString("addHandler", [aName, aURI.host]);
      var self = this;
      var addButton = {
        _outer: self,
        label: self._getString("addHandlerAddButton"),
        accessKey: self._getString("addHandlerAddButtonAccesskey"),
        feedReaderInfo: { uri: uriSpec, name: aName },
        callback:
        function WCCR__addFeedReaderButtonCallback(aNotification, aButtonInfo) {
          var uri = aButtonInfo.feedReaderInfo.uri;
          var name = aButtonInfo.feedReaderInfo.name;
          var outer = aButtonInfo._outer;
          if (!outer.getWebContentHandlerByURI(TYPE_MAYBE_FEED, uri))
            outer._registerContentHandler(TYPE_MAYBE_FEED, uri, name);
          aButtonInfo._outer = null;
          return false;
        }
      };
      buttons = [addButton];
    }
    aNotificationBox.appendNotification(message,
                                        notificationValue,
                                        notificationIcon,
                                        aNotificationBox.PRIORITY_INFO_LOW,
                                        buttons);
    return true;
  }
function WCCR__appendFeedReaderNotification ( aURI , aName , aNotificationBox ) { var uriSpec = aURI . spec ; var notificationValue = "feed reader notification: " + uriSpec ; var notificationIcon = aURI . prePath + "/favicon.ico" ; if ( aNotificationBox . getNotificationWithValue ( notificationValue ) ) return false ; var buttons , message ; if ( this . getWebContentHandlerByURI ( TYPE_MAYBE_FEED , uriSpec ) ) message = this . _getFormattedString ( "handlerRegistered" , [ aName ] ) ; else { message = this . _getFormattedString ( "addHandler" , [ aName , aURI . host ] ) ; var self = this ; var addButton = { _outer : self , label : self . _getString ( "addHandlerAddButton" ) , accessKey : self . _getString ( "addHandlerAddButtonAccesskey" ) , feedReaderInfo : { uri : uriSpec , name : aName } , callback : function WCCR__addFeedReaderButtonCallback ( aNotification , aButtonInfo ) { var uri = aButtonInfo . feedReaderInfo . uri ; var name = aButtonInfo . feedReaderInfo . name ; var outer = aButtonInfo . _outer ; if ( ! outer . getWebContentHandlerByURI ( TYPE_MAYBE_FEED , uri ) ) outer . _registerContentHandler ( TYPE_MAYBE_FEED , uri , name ) ; aButtonInfo . _outer = null ; return false ; } } ; buttons = [ addButton ] ; } aNotificationBox . appendNotification ( message , notificationValue , notificationIcon , aNotificationBox . PRIORITY_INFO_LOW , buttons ) ; return true ; }
Appends a notifcation for the given feed reader details.
Appends a notifcation for the given feed reader details .
// Don't append a new notification if the notificationbox // has a notification for the given feed reader already /* static */ // The reader could have been added from another window mean while // avoid reference cycles