OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.NativeBreakpointsSidebarPane} | 33 * @extends {WebInspector.NativeBreakpointsSidebarPane} |
34 * @implements {WebInspector.TargetManager.Observer} | |
35 */ | 34 */ |
36 WebInspector.DOMBreakpointsSidebarPane = function() | 35 WebInspector.DOMBreakpointsSidebarPane = function() |
37 { | 36 { |
38 WebInspector.NativeBreakpointsSidebarPane.call(this, WebInspector.UIString("
DOM Breakpoints")); | 37 WebInspector.NativeBreakpointsSidebarPane.call(this, WebInspector.UIString("
DOM Breakpoints")); |
39 | 38 |
40 this._breakpointElements = {}; | 39 this._breakpointElements = {}; |
41 | 40 |
42 this._breakpointTypes = { | 41 this._breakpointTypes = { |
43 SubtreeModified: "subtree-modified", | 42 SubtreeModified: "subtree-modified", |
44 AttributeModified: "attribute-modified", | 43 AttributeModified: "attribute-modified", |
45 NodeRemoved: "node-removed" | 44 NodeRemoved: "node-removed" |
46 }; | 45 }; |
47 this._breakpointTypeLabels = {}; | 46 this._breakpointTypeLabels = {}; |
48 this._breakpointTypeLabels[this._breakpointTypes.SubtreeModified] = WebInspe
ctor.UIString("Subtree Modified"); | 47 this._breakpointTypeLabels[this._breakpointTypes.SubtreeModified] = WebInspe
ctor.UIString("Subtree Modified"); |
49 this._breakpointTypeLabels[this._breakpointTypes.AttributeModified] = WebIns
pector.UIString("Attribute Modified"); | 48 this._breakpointTypeLabels[this._breakpointTypes.AttributeModified] = WebIns
pector.UIString("Attribute Modified"); |
50 this._breakpointTypeLabels[this._breakpointTypes.NodeRemoved] = WebInspector
.UIString("Node Removed"); | 49 this._breakpointTypeLabels[this._breakpointTypes.NodeRemoved] = WebInspector
.UIString("Node Removed"); |
51 | 50 |
52 this._contextMenuLabels = {}; | 51 this._contextMenuLabels = {}; |
53 this._contextMenuLabels[this._breakpointTypes.SubtreeModified] = WebInspecto
r.UIString(WebInspector.useLowerCaseMenuTitles() ? "Subtree modifications" : "Su
btree Modifications"); | 52 this._contextMenuLabels[this._breakpointTypes.SubtreeModified] = WebInspecto
r.UIString(WebInspector.useLowerCaseMenuTitles() ? "Subtree modifications" : "Su
btree Modifications"); |
54 this._contextMenuLabels[this._breakpointTypes.AttributeModified] = WebInspec
tor.UIString(WebInspector.useLowerCaseMenuTitles() ? "Attributes modifications"
: "Attributes Modifications"); | 53 this._contextMenuLabels[this._breakpointTypes.AttributeModified] = WebInspec
tor.UIString(WebInspector.useLowerCaseMenuTitles() ? "Attributes modifications"
: "Attributes Modifications"); |
55 this._contextMenuLabels[this._breakpointTypes.NodeRemoved] = WebInspector.UI
String(WebInspector.useLowerCaseMenuTitles() ? "Node removal" : "Node Removal"); | 54 this._contextMenuLabels[this._breakpointTypes.NodeRemoved] = WebInspector.UI
String(WebInspector.useLowerCaseMenuTitles() ? "Node removal" : "Node Removal"); |
56 | 55 |
57 WebInspector.targetManager.observeTargets(this); | 56 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged, this._inspectedUR
LChanged, this); |
| 57 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec
tor.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); |
58 } | 58 } |
59 | 59 |
60 WebInspector.DOMBreakpointsSidebarPane.prototype = { | 60 WebInspector.DOMBreakpointsSidebarPane.prototype = { |
61 /** | |
62 * @param {!WebInspector.Target} target | |
63 */ | |
64 targetAdded: function(target) | |
65 { | |
66 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel
.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this); | |
67 target.domModel.addEventListener(WebInspector.DOMModel.Events.NodeRemove
d, this._nodeRemoved, this); | |
68 }, | |
69 | |
70 /** | |
71 * @param {!WebInspector.Target} target | |
72 */ | |
73 targetRemoved: function(target) | |
74 { | |
75 target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeMo
del.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this); | |
76 target.domModel.removeEventListener(WebInspector.DOMModel.Events.NodeRem
oved, this._nodeRemoved, this); | |
77 }, | |
78 | |
79 _inspectedURLChanged: function(event) | 61 _inspectedURLChanged: function(event) |
80 { | 62 { |
81 this._breakpointElements = {}; | 63 this._breakpointElements = {}; |
82 this.reset(); | 64 this.reset(); |
83 var url = /** @type {string} */ (event.data); | 65 var url = /** @type {string} */ (event.data); |
84 this._inspectedURL = url.removeURLFragment(); | 66 this._inspectedURL = url.removeURLFragment(); |
85 }, | 67 }, |
86 | 68 |
87 /** | 69 /** |
88 * @param {!WebInspector.DOMNode} node | 70 * @param {!WebInspector.DOMNode} node |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 this.element.appendChild(this.bodyElement); | 435 this.element.appendChild(this.bodyElement); |
454 }, | 436 }, |
455 | 437 |
456 __proto__: WebInspector.SidebarPane.prototype | 438 __proto__: WebInspector.SidebarPane.prototype |
457 } | 439 } |
458 | 440 |
459 /** | 441 /** |
460 * @type {!WebInspector.DOMBreakpointsSidebarPane} | 442 * @type {!WebInspector.DOMBreakpointsSidebarPane} |
461 */ | 443 */ |
462 WebInspector.domBreakpointsSidebarPane; | 444 WebInspector.domBreakpointsSidebarPane; |
OLD | NEW |