1 /* See license.txt for terms of usage */ 2 3 define([ 4 "firebug/lib/object", 5 "firebug/firebug", 6 "firebug/dom/domBreakpointGroup", 7 ], 8 function(Obj, Firebug, DOMBreakpointGroup) { 9 10 // ********************************************************************************************* // 11 // Constants 12 13 const Cc = Components.classes; 14 const Ci = Components.interfaces; 15 16 // ********************************************************************************************* // 17 // DOM Module 18 19 Firebug.DOMModule = Obj.extend(Firebug.Module, 20 { 21 dispatchName: "domModule", 22 23 initialize: function(prefDomain, prefNames) 24 { 25 Firebug.Module.initialize.apply(this, arguments); 26 27 if (Firebug.Debugger) 28 Firebug.connection.addListener(this.DebuggerListener); 29 }, 30 31 shutdown: function() 32 { 33 Firebug.Module.shutdown.apply(this, arguments); 34 35 if (Firebug.Debugger) 36 Firebug.connection.removeListener(this.DebuggerListener); 37 }, 38 39 initContext: function(context, persistedState) 40 { 41 Firebug.Module.initContext.apply(this, arguments); 42 43 context.dom = {breakpoints: new DOMBreakpointGroup()}; 44 }, 45 46 loadedContext: function(context, persistedState) 47 { 48 context.dom.breakpoints.load(context); 49 }, 50 51 destroyContext: function(context, persistedState) 52 { 53 Firebug.Module.destroyContext.apply(this, arguments); 54 55 context.dom.breakpoints.store(context); 56 }, 57 }); 58 59 // ********************************************************************************************* // 60 61 Firebug.DOMModule.DebuggerListener = 62 { 63 getBreakpoints: function(context, groups) 64 { 65 if (!context.dom.breakpoints.isEmpty()) 66 groups.push(context.dom.breakpoints); 67 } 68 }; 69 70 // ********************************************************************************************* // 71 // Registration 72 73 Firebug.registerModule(Firebug.DOMModule); 74 75 return Firebug.DOMModule; 76 77 // ********************************************************************************************* // 78 }); 79 80