Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js

Issue 2277543002: DevTools: Simplify DOMBreakpointsSidebarPane inspected URL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor refactor Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 breakpoints.push(breakpoint); 359 breakpoints.push(breakpoint);
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.DOMDocument} domDocument
379 */ 370 */
380 restoreBreakpoints: function(domModel) 371 restoreBreakpoints: function(domDocument)
381 { 372 {
373 this._breakpointElements = {};
374 this.reset();
375 this._inspectedURL = domDocument.documentURL;
376 var domModel = domDocument.domModel();
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
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;
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698