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

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

Issue 2234193002: DevTools: migrate some of the sources panel sidebar panes to view management, allow view toolbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed 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
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 16 matching lines...) Expand all
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.BreakpointsSidebarPaneBase} 33 * @extends {WebInspector.BreakpointsSidebarPaneBase}
34 */ 34 */
35 WebInspector.DOMBreakpointsSidebarPane = function() 35 WebInspector.DOMBreakpointsSidebarPane = function()
36 { 36 {
37 WebInspector.BreakpointsSidebarPaneBase.call(this, WebInspector.UIString("DO M Breakpoints")); 37 WebInspector.BreakpointsSidebarPaneBase.call(this);
38 this._domBreakpointsSetting = WebInspector.settings.createLocalSetting("domB reakpoints", []); 38 this._domBreakpointsSetting = WebInspector.settings.createLocalSetting("domB reakpoints", []);
39 this.listElement.classList.add("dom-breakpoints-list"); 39 this.listElement.classList.add("dom-breakpoints-list");
40 40
41 this._breakpointElements = {}; 41 this._breakpointElements = {};
42 42
43 this._breakpointTypes = { 43 this._breakpointTypes = {
44 SubtreeModified: "subtree-modified", 44 SubtreeModified: "subtree-modified",
45 AttributeModified: "attribute-modified", 45 AttributeModified: "attribute-modified",
46 NodeRemoved: "node-removed" 46 NodeRemoved: "node-removed"
47 }; 47 };
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 */ 313 */
314 _checkboxClicked: function(node, type, event) 314 _checkboxClicked: function(node, type, event)
315 { 315 {
316 if (event.target.checked) 316 if (event.target.checked)
317 node.target().domdebuggerAgent().setDOMBreakpoint(node.id, type); 317 node.target().domdebuggerAgent().setDOMBreakpoint(node.id, type);
318 else 318 else
319 node.target().domdebuggerAgent().removeDOMBreakpoint(node.id, type); 319 node.target().domdebuggerAgent().removeDOMBreakpoint(node.id, type);
320 this._saveBreakpoints(); 320 this._saveBreakpoints();
321 }, 321 },
322 322
323 highlightBreakpoint: function(auxData) 323 /**
324 * @override
325 * @param {?WebInspector.DebuggerPausedDetails} details
326 */
327 highlightDetails: function(details)
324 { 328 {
329 if (!details || details.reason !== WebInspector.DebuggerModel.BreakReaso n.DOM) {
330 if (this._highlightedElement) {
331 this._highlightedElement.classList.remove("breakpoint-hit");
332 delete this._highlightedElement;
333 }
334 return;
335 }
336 var auxData = details.auxData;
325 var breakpointId = this._createBreakpointId(auxData.nodeId, auxData.type ); 337 var breakpointId = this._createBreakpointId(auxData.nodeId, auxData.type );
326 var element = this._breakpointElements[breakpointId]; 338 var element = this._breakpointElements[breakpointId];
327 if (!element) 339 if (!element)
328 return; 340 return;
329 this.revealView(); 341 WebInspector.viewManager.revealViewWithWidget(this);
330 element.classList.add("breakpoint-hit"); 342 element.classList.add("breakpoint-hit");
331 this._highlightedElement = element; 343 this._highlightedElement = element;
332 }, 344 },
333 345
334 clearBreakpointHighlight: function()
335 {
336 if (this._highlightedElement) {
337 this._highlightedElement.classList.remove("breakpoint-hit");
338 delete this._highlightedElement;
339 }
340 },
341
342 /** 346 /**
343 * @param {number} nodeId 347 * @param {number} nodeId
344 * @param {!DOMDebuggerAgent.DOMBreakpointType} type 348 * @param {!DOMDebuggerAgent.DOMBreakpointType} type
345 */ 349 */
346 _createBreakpointId: function(nodeId, type) 350 _createBreakpointId: function(nodeId, type)
347 { 351 {
348 return nodeId + ":" + type; 352 return nodeId + ":" + type;
349 }, 353 },
350 354
351 _saveBreakpoints: function() 355 _saveBreakpoints: function()
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 pane.show(this.element); 427 pane.show(this.element);
424 }, 428 },
425 429
426 __proto__: WebInspector.VBox.prototype 430 __proto__: WebInspector.VBox.prototype
427 } 431 }
428 432
429 /** 433 /**
430 * @type {!WebInspector.DOMBreakpointsSidebarPane} 434 * @type {!WebInspector.DOMBreakpointsSidebarPane}
431 */ 435 */
432 WebInspector.domBreakpointsSidebarPane; 436 WebInspector.domBreakpointsSidebarPane;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698