|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
|
6 |
|
7 const Cc = Components.classes; |
|
8 const Ci = Components.interfaces; |
|
9 |
|
10 // Dummy boomark/history observer |
|
11 function DummyObserver() { |
|
12 let os = Cc["@mozilla.org/observer-service;1"]. |
|
13 getService(Ci.nsIObserverService); |
|
14 os.notifyObservers(null, "dummy-observer-created", null); |
|
15 } |
|
16 |
|
17 DummyObserver.prototype = { |
|
18 // history observer |
|
19 onBeginUpdateBatch: function () {}, |
|
20 onEndUpdateBatch: function () {}, |
|
21 onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID, aTransitionType) { |
|
22 let os = Cc["@mozilla.org/observer-service;1"]. |
|
23 getService(Ci.nsIObserverService); |
|
24 os.notifyObservers(null, "dummy-observer-visited", null); |
|
25 }, |
|
26 onTitleChanged: function () {}, |
|
27 onDeleteURI: function () {}, |
|
28 onClearHistory: function () {}, |
|
29 onPageChanged: function () {}, |
|
30 onDeleteVisits: function () {}, |
|
31 |
|
32 // bookmark observer |
|
33 //onBeginUpdateBatch: function() {}, |
|
34 //onEndUpdateBatch: function() {}, |
|
35 onItemAdded: function(aItemId, aParentId, aIndex, aItemType, aURI) { |
|
36 let os = Cc["@mozilla.org/observer-service;1"]. |
|
37 getService(Ci.nsIObserverService); |
|
38 os.notifyObservers(null, "dummy-observer-item-added", null); |
|
39 }, |
|
40 onItemChanged: function () {}, |
|
41 onItemRemoved: function() {}, |
|
42 onItemVisited: function() {}, |
|
43 onItemMoved: function() {}, |
|
44 |
|
45 classID: Components.ID("62e221d3-68c3-4e1a-8943-a27beb5005fe"), |
|
46 |
|
47 QueryInterface: XPCOMUtils.generateQI([ |
|
48 Ci.nsINavBookmarkObserver, |
|
49 Ci.nsINavHistoryObserver, |
|
50 ]) |
|
51 }; |
|
52 |
|
53 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); |