From 997d30a4e234ba0252b8adc5b8a64e539d5d24a7 Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" Date: Sun, 14 Jan 2007 05:37:58 +0000 Subject: [PATCH] factor out code for updating and refreshing microsummaries when the user selects a new one from the bookmark dialogs bug=339296 r=mconnor git-svn-id: svn://10.0.0.236/trunk@218326 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/nsMicrosummaryService.js | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js b/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js index e525ea6d5a2..b0ebf1a148c 100644 --- a/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js +++ b/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js @@ -771,23 +771,10 @@ MicrosummaryService.prototype = { */ setMicrosummary: function MSS_setMicrosummary(bookmarkID, microsummary) { this._setField(bookmarkID, FIELD_MICSUM_GEN_URI, microsummary.generatorURI.spec); - - // If the microsummary content has already been generated, - // set the URI's generated title to the microsummary content - // and expire the microsummary after the normal interval. - if (microsummary.content) { - var now = new Date().getTime(); - this._setField(bookmarkID, FIELD_GENERATED_TITLE, microsummary.content); - this._setField(bookmarkID, FIELD_MICSUM_EXPIRATION, now + UPDATE_INTERVAL); - } - - // Otherwise, expire the microsummary and update it immediately. - else { - if (this._hasField(bookmarkID, FIELD_MICSUM_EXPIRATION)) - this._clearField(bookmarkID, FIELD_MICSUM_EXPIRATION); - microsummary.addObserver(this); - microsummary.update(); - } + if (microsummary.content) + this._updateMicrosummary(bookmarkID, microsummary); + else + this.refreshMicrosummary(bookmarkID); }, /**