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

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

Issue 1172643002: DevTools: migrate sidebar pane's titleElement to use Toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: only using latin1 in css Created 5 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) 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 * @param {!DOMDebuggerAgent.DOMBreakpointType} type 216 * @param {!DOMDebuggerAgent.DOMBreakpointType} type
217 * @param {boolean} enabled 217 * @param {boolean} enabled
218 */ 218 */
219 _createBreakpointElement: function(node, type, enabled) 219 _createBreakpointElement: function(node, type, enabled)
220 { 220 {
221 var element = createElement("li"); 221 var element = createElement("li");
222 element._node = node; 222 element._node = node;
223 element._type = type; 223 element._type = type;
224 element.addEventListener("contextmenu", this._contextMenu.bind(this, nod e, type), true); 224 element.addEventListener("contextmenu", this._contextMenu.bind(this, nod e, type), true);
225 225
226 var checkboxElement = createElement("input"); 226 var checkboxElement = createCheckboxLabel("", enabled);
227 checkboxElement.className = "checkbox-elem";
228 checkboxElement.type = "checkbox";
229 checkboxElement.checked = enabled;
230 checkboxElement.addEventListener("click", this._checkboxClicked.bind(thi s, node, type), false); 227 checkboxElement.addEventListener("click", this._checkboxClicked.bind(thi s, node, type), false);
231 element._checkboxElement = checkboxElement; 228 element._checkboxElement = checkboxElement;
232 element.appendChild(checkboxElement); 229 element.appendChild(checkboxElement);
233 230
234 var labelElement = createElement("span"); 231 var labelElement = createElement("span");
235 element.appendChild(labelElement); 232 element.appendChild(labelElement);
236 233
237 var linkifiedNode = WebInspector.DOMPresentationUtils.linkifyNodeReferen ce(node); 234 var linkifiedNode = WebInspector.DOMPresentationUtils.linkifyNodeReferen ce(node);
238 linkifiedNode.classList.add("monospace"); 235 linkifiedNode.classList.add("monospace");
239 labelElement.appendChild(linkifiedNode); 236 labelElement.appendChild(linkifiedNode);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 416 }
420 417
421 /** 418 /**
422 * @constructor 419 * @constructor
423 * @extends {WebInspector.SidebarPane} 420 * @extends {WebInspector.SidebarPane}
424 * @param {!WebInspector.DOMBreakpointsSidebarPane} pane 421 * @param {!WebInspector.DOMBreakpointsSidebarPane} pane
425 * @param {!WebInspector.Panel} panel 422 * @param {!WebInspector.Panel} panel
426 */ 423 */
427 WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel) 424 WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel)
428 { 425 {
429 WebInspector.Widget.__assert(!pane.titleElement.firstChild, "Cannot create p roxy for a sidebar pane with a toolbar");
430
431 WebInspector.SidebarPane.call(this, pane.title()); 426 WebInspector.SidebarPane.call(this, pane.title());
432 this.registerRequiredCSS("components/breakpointsList.css"); 427 this.registerRequiredCSS("components/breakpointsList.css");
433 428
434 this._wrappedPane = pane; 429 this._wrappedPane = pane;
435 this._panel = panel; 430 this._panel = panel;
436
437 this.bodyElement.remove();
438 this.bodyElement = this._wrappedPane.bodyElement;
439 } 431 }
440 432
441 WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = { 433 WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = {
442 expand: function() 434 expand: function()
443 { 435 {
444 this._wrappedPane.expand(); 436 this._wrappedPane.expand();
445 }, 437 },
446 438
447 onContentReady: function() 439 onContentReady: function()
448 { 440 {
449 if (this._panel.isShowing()) 441 if (this._panel.isShowing())
450 this._reattachBody(); 442 this._reattachBody();
451 443
452 WebInspector.SidebarPane.prototype.onContentReady.call(this); 444 WebInspector.SidebarPane.prototype.onContentReady.call(this);
453 }, 445 },
454 446
455 wasShown: function() 447 wasShown: function()
456 { 448 {
457 WebInspector.SidebarPane.prototype.wasShown.call(this); 449 WebInspector.SidebarPane.prototype.wasShown.call(this);
458 this._reattachBody(); 450 this._reattachBody();
459 }, 451 },
460 452
461 _reattachBody: function() 453 _reattachBody: function()
462 { 454 {
463 if (this.bodyElement.parentNode !== this.element) 455 if (this._wrappedPane.element.parentNode !== this.element)
464 this.element.appendChild(this.bodyElement); 456 this._wrappedPane.show(this.element);
465 }, 457 },
466 458
467 __proto__: WebInspector.SidebarPane.prototype 459 __proto__: WebInspector.SidebarPane.prototype
468 } 460 }
469 461
470 /** 462 /**
471 * @type {!WebInspector.DOMBreakpointsSidebarPane} 463 * @type {!WebInspector.DOMBreakpointsSidebarPane}
472 */ 464 */
473 WebInspector.domBreakpointsSidebarPane; 465 WebInspector.domBreakpointsSidebarPane;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698