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

Side by Side Diff: Source/devtools/front_end/sources/BreakpointsSidebarPane.js

Issue 351903003: DevTools: Avoid private member access in non-profiler code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 this.expand(); 321 this.expand();
322 322
323 var inputElementContainer = document.createElement("p"); 323 var inputElementContainer = document.createElement("p");
324 inputElementContainer.className = "breakpoint-condition"; 324 inputElementContainer.className = "breakpoint-condition";
325 var inputElement = document.createElement("span"); 325 var inputElement = document.createElement("span");
326 inputElementContainer.textContent = WebInspector.UIString("Break when UR L contains:"); 326 inputElementContainer.textContent = WebInspector.UIString("Break when UR L contains:");
327 inputElement.className = "editing"; 327 inputElement.className = "editing";
328 inputElement.id = "breakpoint-condition-input"; 328 inputElement.id = "breakpoint-condition-input";
329 inputElementContainer.appendChild(inputElement); 329 inputElementContainer.appendChild(inputElement);
330 this._addListElement(inputElementContainer, this.listElement.firstChild) ; 330 this.addListElement(inputElementContainer, /** @type {?Element} */ (this .listElement.firstChild));
331 331
332 /** 332 /**
333 * @param {boolean} accept 333 * @param {boolean} accept
334 * @param {!Element} e 334 * @param {!Element} e
335 * @param {string} text 335 * @param {string} text
336 * @this {WebInspector.XHRBreakpointsSidebarPane} 336 * @this {WebInspector.XHRBreakpointsSidebarPane}
337 */ 337 */
338 function finishEditing(accept, e, text) 338 function finishEditing(accept, e, text)
339 { 339 {
340 this._removeListElement(inputElementContainer); 340 this.removeListElement(inputElementContainer);
341 if (accept) { 341 if (accept) {
342 this._setBreakpoint(text, true); 342 this._setBreakpoint(text, true);
343 this._saveBreakpoints(); 343 this._saveBreakpoints();
344 } 344 }
345 } 345 }
346 346
347 var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(th is, true), finishEditing.bind(this, false)); 347 var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(th is, true), finishEditing.bind(this, false));
348 WebInspector.InplaceEditor.startEditing(inputElement, config); 348 WebInspector.InplaceEditor.startEditing(inputElement, config);
349 }, 349 },
350 350
(...skipping 16 matching lines...) Expand all
367 367
368 var labelElement = document.createElement("span"); 368 var labelElement = document.createElement("span");
369 if (!url) 369 if (!url)
370 labelElement.textContent = WebInspector.UIString("Any XHR"); 370 labelElement.textContent = WebInspector.UIString("Any XHR");
371 else 371 else
372 labelElement.textContent = WebInspector.UIString("URL contains \"%s\ "", url); 372 labelElement.textContent = WebInspector.UIString("URL contains \"%s\ "", url);
373 labelElement.classList.add("cursor-auto"); 373 labelElement.classList.add("cursor-auto");
374 labelElement.addEventListener("dblclick", this._labelClicked.bind(this, url), false); 374 labelElement.addEventListener("dblclick", this._labelClicked.bind(this, url), false);
375 element.appendChild(labelElement); 375 element.appendChild(labelElement);
376 376
377 var currentElement = this.listElement.firstChild; 377 var currentElement = /** @type {?Element} */ (this.listElement.firstChil d);
378 while (currentElement) { 378 while (currentElement) {
379 if (currentElement._url && currentElement._url < element._url) 379 if (currentElement._url && currentElement._url < element._url)
380 break; 380 break;
381 currentElement = currentElement.nextSibling; 381 currentElement = /** @type {?Element} */ (currentElement.nextSibling );
382 } 382 }
383 this._addListElement(element, currentElement); 383 this.addListElement(element, currentElement);
384 this._breakpointElements[url] = element; 384 this._breakpointElements[url] = element;
385 if (enabled) 385 if (enabled)
386 DOMDebuggerAgent.setXHRBreakpoint(url); 386 DOMDebuggerAgent.setXHRBreakpoint(url);
387 }, 387 },
388 388
389 _removeBreakpoint: function(url) 389 _removeBreakpoint: function(url)
390 { 390 {
391 var element = this._breakpointElements[url]; 391 var element = this._breakpointElements[url];
392 if (!element) 392 if (!element)
393 return; 393 return;
394 394
395 this._removeListElement(element); 395 this.removeListElement(element);
396 delete this._breakpointElements[url]; 396 delete this._breakpointElements[url];
397 if (element._checkboxElement.checked) 397 if (element._checkboxElement.checked)
398 DOMDebuggerAgent.removeXHRBreakpoint(url); 398 DOMDebuggerAgent.removeXHRBreakpoint(url);
399 }, 399 },
400 400
401 _contextMenu: function(url, event) 401 _contextMenu: function(url, event)
402 { 402 {
403 var contextMenu = new WebInspector.ContextMenu(event); 403 var contextMenu = new WebInspector.ContextMenu(event);
404 404
405 /** 405 /**
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 element.classList.add("hidden"); 447 element.classList.add("hidden");
448 448
449 /** 449 /**
450 * @param {boolean} accept 450 * @param {boolean} accept
451 * @param {!Element} e 451 * @param {!Element} e
452 * @param {string} text 452 * @param {string} text
453 * @this {WebInspector.XHRBreakpointsSidebarPane} 453 * @this {WebInspector.XHRBreakpointsSidebarPane}
454 */ 454 */
455 function finishEditing(accept, e, text) 455 function finishEditing(accept, e, text)
456 { 456 {
457 this._removeListElement(inputElement); 457 this.removeListElement(inputElement);
458 if (accept) { 458 if (accept) {
459 this._removeBreakpoint(url); 459 this._removeBreakpoint(url);
460 this._setBreakpoint(text, element._checkboxElement.checked); 460 this._setBreakpoint(text, element._checkboxElement.checked);
461 this._saveBreakpoints(); 461 this._saveBreakpoints();
462 } else 462 } else
463 element.classList.remove("hidden"); 463 element.classList.remove("hidden");
464 } 464 }
465 465
466 WebInspector.InplaceEditor.startEditing(inputElement, new WebInspector.I nplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, fal se))); 466 WebInspector.InplaceEditor.startEditing(inputElement, new WebInspector.I nplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, fal se)));
467 }, 467 },
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 var breakpoints = WebInspector.settings.eventListenerBreakpoints.get(); 807 var breakpoints = WebInspector.settings.eventListenerBreakpoints.get();
808 for (var i = 0; i < breakpoints.length; ++i) { 808 for (var i = 0; i < breakpoints.length; ++i) {
809 var breakpoint = breakpoints[i]; 809 var breakpoint = breakpoints[i];
810 if (breakpoint && typeof breakpoint.eventName === "string") 810 if (breakpoint && typeof breakpoint.eventName === "string")
811 this._setBreakpoint(breakpoint.eventName, breakpoint.targetNames ); 811 this._setBreakpoint(breakpoint.eventName, breakpoint.targetNames );
812 } 812 }
813 }, 813 },
814 814
815 __proto__: WebInspector.SidebarPane.prototype 815 __proto__: WebInspector.SidebarPane.prototype
816 } 816 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/LayerTreeModel.js ('k') | Source/devtools/front_end/timeline/Layers3DView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698