michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: michael@0: // Dummy boomark/history observer michael@0: function DummyObserver() { michael@0: let os = Cc["@mozilla.org/observer-service;1"]. michael@0: getService(Ci.nsIObserverService); michael@0: os.notifyObservers(null, "dummy-observer-created", null); michael@0: } michael@0: michael@0: DummyObserver.prototype = { michael@0: // history observer michael@0: onBeginUpdateBatch: function () {}, michael@0: onEndUpdateBatch: function () {}, michael@0: onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID, aTransitionType) { michael@0: let os = Cc["@mozilla.org/observer-service;1"]. michael@0: getService(Ci.nsIObserverService); michael@0: os.notifyObservers(null, "dummy-observer-visited", null); michael@0: }, michael@0: onTitleChanged: function () {}, michael@0: onDeleteURI: function () {}, michael@0: onClearHistory: function () {}, michael@0: onPageChanged: function () {}, michael@0: onDeleteVisits: function () {}, michael@0: michael@0: // bookmark observer michael@0: //onBeginUpdateBatch: function() {}, michael@0: //onEndUpdateBatch: function() {}, michael@0: onItemAdded: function(aItemId, aParentId, aIndex, aItemType, aURI) { michael@0: let os = Cc["@mozilla.org/observer-service;1"]. michael@0: getService(Ci.nsIObserverService); michael@0: os.notifyObservers(null, "dummy-observer-item-added", null); michael@0: }, michael@0: onItemChanged: function () {}, michael@0: onItemRemoved: function() {}, michael@0: onItemVisited: function() {}, michael@0: onItemMoved: function() {}, michael@0: michael@0: classID: Components.ID("62e221d3-68c3-4e1a-8943-a27beb5005fe"), michael@0: michael@0: QueryInterface: XPCOMUtils.generateQI([ michael@0: Ci.nsINavBookmarkObserver, michael@0: Ci.nsINavHistoryObserver, michael@0: ]) michael@0: }; michael@0: michael@0: this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]);