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

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

Issue 2157713002: DevTools: introduce View: a named widget with the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 node.target().domdebuggerAgent().removeDOMBreakpoint(node.id, type); 341 node.target().domdebuggerAgent().removeDOMBreakpoint(node.id, type);
342 this._saveBreakpoints(); 342 this._saveBreakpoints();
343 }, 343 },
344 344
345 highlightBreakpoint: function(auxData) 345 highlightBreakpoint: function(auxData)
346 { 346 {
347 var breakpointId = this._createBreakpointId(auxData.nodeId, auxData.type ); 347 var breakpointId = this._createBreakpointId(auxData.nodeId, auxData.type );
348 var element = this._breakpointElements[breakpointId]; 348 var element = this._breakpointElements[breakpointId];
349 if (!element) 349 if (!element)
350 return; 350 return;
351 this.expandPane(); 351 this.requestReveal();
352 element.classList.add("breakpoint-hit"); 352 element.classList.add("breakpoint-hit");
353 this._highlightedElement = element; 353 this._highlightedElement = element;
354 }, 354 },
355 355
356 clearBreakpointHighlight: function() 356 clearBreakpointHighlight: function()
357 { 357 {
358 if (this._highlightedElement) { 358 if (this._highlightedElement) {
359 this._highlightedElement.classList.remove("breakpoint-hit"); 359 this._highlightedElement.classList.remove("breakpoint-hit");
360 delete this._highlightedElement; 360 delete this._highlightedElement;
361 } 361 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 */ 429 */
430 createProxy: function(panel) 430 createProxy: function(panel)
431 { 431 {
432 var proxy = new WebInspector.DOMBreakpointsSidebarPane.Proxy(this, panel ); 432 var proxy = new WebInspector.DOMBreakpointsSidebarPane.Proxy(this, panel );
433 if (!this._proxies) 433 if (!this._proxies)
434 this._proxies = []; 434 this._proxies = [];
435 this._proxies.push(proxy); 435 this._proxies.push(proxy);
436 return proxy; 436 return proxy;
437 }, 437 },
438 438
439 onContentReady: function()
440 {
441 for (var i = 0; i < this._proxies.length; i++)
442 this._proxies[i].onContentReady();
443 },
444
445 __proto__: WebInspector.BreakpointsSidebarPaneBase.prototype 439 __proto__: WebInspector.BreakpointsSidebarPaneBase.prototype
446 } 440 }
447 441
448 /** 442 /**
449 * @constructor 443 * @constructor
450 * @extends {WebInspector.SidebarPane} 444 * @extends {WebInspector.View}
451 * @param {!WebInspector.DOMBreakpointsSidebarPane} pane 445 * @param {!WebInspector.DOMBreakpointsSidebarPane} pane
452 * @param {!WebInspector.Panel} panel 446 * @param {!WebInspector.Panel} panel
453 */ 447 */
454 WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel) 448 WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel)
455 { 449 {
456 WebInspector.SidebarPane.call(this, WebInspector.UIString("DOM Breakpoints") ); 450 WebInspector.View.call(this, WebInspector.UIString("DOM Breakpoints"));
457 this.registerRequiredCSS("components/breakpointsList.css"); 451 this.registerRequiredCSS("components/breakpointsList.css");
458 452
459 this._wrappedPane = pane; 453 this._wrappedPane = pane;
460 this._panel = panel; 454 this._panel = panel;
461 } 455 }
462 456
463 WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = { 457 WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = {
464 expandPane: function()
465 {
466 this._wrappedPane.expandPane();
467 },
468
469 onContentReady: function()
470 {
471 if (this._panel.isShowing())
472 this._reattachBody();
473
474 WebInspector.SidebarPane.prototype.onContentReady.call(this);
475 },
476
477 wasShown: function() 458 wasShown: function()
478 { 459 {
479 WebInspector.SidebarPane.prototype.wasShown.call(this); 460 WebInspector.View.prototype.wasShown.call(this);
480 this._reattachBody(); 461 this._reattachBody();
481 }, 462 },
482 463
483 _reattachBody: function() 464 _reattachBody: function()
484 { 465 {
485 if (this._wrappedPane.element.parentNode !== this.element) 466 if (this._wrappedPane.element.parentNode !== this.element)
486 this._wrappedPane.show(this.element); 467 this._wrappedPane.show(this.element);
487 }, 468 },
488 469
489 __proto__: WebInspector.SidebarPane.prototype 470 __proto__: WebInspector.View.prototype
490 } 471 }
491 472
492 /** 473 /**
493 * @type {!WebInspector.DOMBreakpointsSidebarPane} 474 * @type {!WebInspector.DOMBreakpointsSidebarPane}
494 */ 475 */
495 WebInspector.domBreakpointsSidebarPane; 476 WebInspector.domBreakpointsSidebarPane;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698