Chromium Code Reviews| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 this._breakpointTypeLabels[this._breakpointTypes.SubtreeModified] = WebInspe ctor.UIString("Subtree Modified"); | 50 this._breakpointTypeLabels[this._breakpointTypes.SubtreeModified] = WebInspe ctor.UIString("Subtree Modified"); |
| 51 this._breakpointTypeLabels[this._breakpointTypes.AttributeModified] = WebIns pector.UIString("Attribute Modified"); | 51 this._breakpointTypeLabels[this._breakpointTypes.AttributeModified] = WebIns pector.UIString("Attribute Modified"); |
| 52 this._breakpointTypeLabels[this._breakpointTypes.NodeRemoved] = WebInspector .UIString("Node Removed"); | 52 this._breakpointTypeLabels[this._breakpointTypes.NodeRemoved] = WebInspector .UIString("Node Removed"); |
| 53 | 53 |
| 54 this._contextMenuLabels = {}; | 54 this._contextMenuLabels = {}; |
| 55 this._contextMenuLabels[this._breakpointTypes.SubtreeModified] = WebInspecto r.UIString.capitalize("Subtree ^modifications"); | 55 this._contextMenuLabels[this._breakpointTypes.SubtreeModified] = WebInspecto r.UIString.capitalize("Subtree ^modifications"); |
| 56 this._contextMenuLabels[this._breakpointTypes.AttributeModified] = WebInspec tor.UIString.capitalize("Attributes ^modifications"); | 56 this._contextMenuLabels[this._breakpointTypes.AttributeModified] = WebInspec tor.UIString.capitalize("Attributes ^modifications"); |
| 57 this._contextMenuLabels[this._breakpointTypes.NodeRemoved] = WebInspector.UI String.capitalize("Node ^removal"); | 57 this._contextMenuLabels[this._breakpointTypes.NodeRemoved] = WebInspector.UI String.capitalize("Node ^removal"); |
| 58 | 58 |
| 59 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec tor.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); | 59 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec tor.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); |
| 60 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.InspectedURLChanged, this._inspectedURLChanged, this); | |
| 61 this._inspectedURL = WebInspector.targetManager.inspectedURL(); | |
| 62 this._update(); | 60 this._update(); |
| 63 } | 61 } |
| 64 | 62 |
| 65 WebInspector.DOMBreakpointsSidebarPane.Marker = "breakpoint-marker"; | 63 WebInspector.DOMBreakpointsSidebarPane.Marker = "breakpoint-marker"; |
| 66 | 64 |
| 67 WebInspector.DOMBreakpointsSidebarPane.prototype = { | 65 WebInspector.DOMBreakpointsSidebarPane.prototype = { |
| 68 _inspectedURLChanged: function() | |
| 69 { | |
| 70 this._breakpointElements = {}; | |
| 71 this.reset(); | |
| 72 this._inspectedURL = WebInspector.targetManager.inspectedURL(); | |
| 73 }, | |
| 74 | |
| 75 /** | 66 /** |
| 76 * @param {!WebInspector.DOMNode} node | 67 * @param {!WebInspector.DOMNode} node |
| 77 * @param {!WebInspector.ContextMenu} contextMenu | 68 * @param {!WebInspector.ContextMenu} contextMenu |
| 78 * @param {boolean} createSubMenu | 69 * @param {boolean} createSubMenu |
| 79 */ | 70 */ |
| 80 populateNodeContextMenu: function(node, contextMenu, createSubMenu) | 71 populateNodeContextMenu: function(node, contextMenu, createSubMenu) |
| 81 { | 72 { |
| 82 if (node.pseudoType()) | 73 if (node.pseudoType()) |
| 83 return; | 74 return; |
| 84 | 75 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 } | 360 } |
| 370 for (var id in this._breakpointElements) { | 361 for (var id in this._breakpointElements) { |
| 371 var element = this._breakpointElements[id]; | 362 var element = this._breakpointElements[id]; |
| 372 breakpoints.push({ url: this._inspectedURL, path: element._node.path (), type: element._type, enabled: element._checkboxElement.checked }); | 363 breakpoints.push({ url: this._inspectedURL, path: element._node.path (), type: element._type, enabled: element._checkboxElement.checked }); |
| 373 } | 364 } |
| 374 this._domBreakpointsSetting.set(breakpoints); | 365 this._domBreakpointsSetting.set(breakpoints); |
| 375 }, | 366 }, |
| 376 | 367 |
| 377 /** | 368 /** |
| 378 * @param {!WebInspector.DOMModel} domModel | 369 * @param {!WebInspector.DOMModel} domModel |
| 370 * @param {!WebInspector.DOMDocument} domDocument | |
| 379 */ | 371 */ |
| 380 restoreBreakpoints: function(domModel) | 372 restoreBreakpoints: function(domModel, domDocument) |
|
lushnikov
2016/08/23 23:26:07
no need to pass domModel in here; you can get it f
chenwilliam
2016/08/24 00:18:52
Done.
| |
| 381 { | 373 { |
| 374 this._breakpointElements = {}; | |
| 375 this.reset(); | |
| 376 this._inspectedURL = domDocument.documentURL; | |
| 382 var pathToBreakpoints = {}; | 377 var pathToBreakpoints = {}; |
| 383 | 378 |
| 384 /** | 379 /** |
| 385 * @param {string} path | 380 * @param {string} path |
| 386 * @param {?DOMAgent.NodeId} nodeId | 381 * @param {?DOMAgent.NodeId} nodeId |
| 387 * @this {WebInspector.DOMBreakpointsSidebarPane} | 382 * @this {WebInspector.DOMBreakpointsSidebarPane} |
| 388 */ | 383 */ |
| 389 function didPushNodeByPathToFrontend(path, nodeId) | 384 function didPushNodeByPathToFrontend(path, nodeId) |
| 390 { | 385 { |
| 391 var node = nodeId ? domModel.nodeForId(nodeId) : null; | 386 var node = nodeId ? domModel.nodeForId(nodeId) : null; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 pane.show(this.element); | 428 pane.show(this.element); |
| 434 }, | 429 }, |
| 435 | 430 |
| 436 __proto__: WebInspector.VBox.prototype | 431 __proto__: WebInspector.VBox.prototype |
| 437 } | 432 } |
| 438 | 433 |
| 439 /** | 434 /** |
| 440 * @type {!WebInspector.DOMBreakpointsSidebarPane} | 435 * @type {!WebInspector.DOMBreakpointsSidebarPane} |
| 441 */ | 436 */ |
| 442 WebInspector.domBreakpointsSidebarPane; | 437 WebInspector.domBreakpointsSidebarPane; |
| OLD | NEW |