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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js

Issue 2356423002: [DevTools] Turn WebInspector.Panel into a web component.
Patch Set: partial fixes Created 4 years, 2 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 this._networkLogShowOverviewSetting = WebInspector.settings.createSetting("n etworkLogShowOverview", true); 42 this._networkLogShowOverviewSetting = WebInspector.settings.createSetting("n etworkLogShowOverview", true);
43 this._networkLogLargeRowsSetting = WebInspector.settings.createSetting("netw orkLogLargeRows", false); 43 this._networkLogLargeRowsSetting = WebInspector.settings.createSetting("netw orkLogLargeRows", false);
44 this._networkRecordFilmStripSetting = WebInspector.settings.createSetting("n etworkRecordFilmStripSetting", false); 44 this._networkRecordFilmStripSetting = WebInspector.settings.createSetting("n etworkRecordFilmStripSetting", false);
45 this._toggleRecordAction = /** @type {!WebInspector.Action }*/(WebInspector. actionRegistry.action("network.toggle-recording")); 45 this._toggleRecordAction = /** @type {!WebInspector.Action }*/(WebInspector. actionRegistry.action("network.toggle-recording"));
46 46
47 /** @type {?WebInspector.FilmStripView} */ 47 /** @type {?WebInspector.FilmStripView} */
48 this._filmStripView = null; 48 this._filmStripView = null;
49 /** @type {?WebInspector.NetworkPanel.FilmStripRecorder} */ 49 /** @type {?WebInspector.NetworkPanel.FilmStripRecorder} */
50 this._filmStripRecorder = null; 50 this._filmStripRecorder = null;
51 51
52 this._panelToolbar = new WebInspector.Toolbar("", this.element); 52 this._panelToolbar = new WebInspector.Toolbar("", this.contentElement);
53 this._filterBar = new WebInspector.FilterBar("networkPanel", true); 53 this._filterBar = new WebInspector.FilterBar("networkPanel", true);
54 this._filterBar.show(this.element); 54 this._filterBar.show(this.contentElement);
55 55
56 // Create top overview component. 56 // Create top overview component.
57 this._overviewPane = new WebInspector.TimelineOverviewPane("network"); 57 this._overviewPane = new WebInspector.TimelineOverviewPane("network");
58 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this)); 58 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this));
59 this._overviewPane.element.id = "network-overview-panel"; 59 this._overviewPane.element.id = "network-overview-panel";
60 this._networkOverview = new WebInspector.NetworkOverview(); 60 this._networkOverview = new WebInspector.NetworkOverview();
61 this._overviewPane.setOverviewControls([this._networkOverview]); 61 this._overviewPane.setOverviewControls([this._networkOverview]);
62 this._calculator = new WebInspector.NetworkTransferTimeCalculator(); 62 this._calculator = new WebInspector.NetworkTransferTimeCalculator();
63 63
64 this._splitWidget = new WebInspector.SplitWidget(true, false, "networkPanelS plitViewState"); 64 this._splitWidget = new WebInspector.SplitWidget(true, false, "networkPanelS plitViewState");
65 this._splitWidget.hideMain(); 65 this._splitWidget.hideMain();
66 66
67 this._splitWidget.show(this.element); 67 this._splitWidget.show(this.contentElement);
68 68
69 this._progressBarContainer = createElement("div"); 69 this._progressBarContainer = createElement("div");
70 this._createToolbarButtons(); 70 this._createToolbarButtons();
71 71
72 this._searchableView = new WebInspector.SearchableView(this); 72 this._searchableView = new WebInspector.SearchableView(this);
73 this._searchableView.setPlaceholder(WebInspector.UIString("Find by filename or path")); 73 this._searchableView.setPlaceholder(WebInspector.UIString("Find by filename or path"));
74 74
75 /** @type {!WebInspector.NetworkLogView} */ 75 /** @type {!WebInspector.NetworkLogView} */
76 this._networkLogView = new WebInspector.NetworkLogView(this._filterBar, this ._progressBarContainer, this._networkLogLargeRowsSetting); 76 this._networkLogView = new WebInspector.NetworkLogView(this._filterBar, this ._progressBarContainer, this._networkLogLargeRowsSetting);
77 this._networkLogView.show(this._searchableView.element); 77 this._networkLogView.show(this._searchableView.element);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 _toggleLargerRequests: function() 279 _toggleLargerRequests: function()
280 { 280 {
281 this._updateUI(); 281 this._updateUI();
282 }, 282 },
283 283
284 _toggleShowOverview: function() 284 _toggleShowOverview: function()
285 { 285 {
286 var toggled = this._networkLogShowOverviewSetting.get(); 286 var toggled = this._networkLogShowOverviewSetting.get();
287 if (toggled) 287 if (toggled)
288 this._overviewPane.show(this.element, this._splitWidget.element); 288 this._overviewPane.show(this.contentElement, this._splitWidget.eleme nt);
289 else 289 else
290 this._overviewPane.detach(); 290 this._overviewPane.detach();
291 this.doResize(); 291 this.doResize();
292 }, 292 },
293 293
294 _toggleRecordFilmStrip: function() 294 _toggleRecordFilmStrip: function()
295 { 295 {
296 var toggled = this._networkRecordFilmStripSetting.get(); 296 var toggled = this._networkRecordFilmStripSetting.get();
297 if (toggled && !this._filmStripRecorder) { 297 if (toggled && !this._filmStripRecorder) {
298 this._filmStripView = new WebInspector.FilmStripView(); 298 this._filmStripView = new WebInspector.FilmStripView();
299 this._filmStripView.setMode(WebInspector.FilmStripView.Modes.FrameBa sed); 299 this._filmStripView.setMode(WebInspector.FilmStripView.Modes.FrameBa sed);
300 this._filmStripView.element.classList.add("network-film-strip"); 300 this._filmStripView.element.classList.add("network-film-strip");
301 this._filmStripRecorder = new WebInspector.NetworkPanel.FilmStripRec order(this._networkLogView.timeCalculator(), this._filmStripView); 301 this._filmStripRecorder = new WebInspector.NetworkPanel.FilmStripRec order(this._networkLogView.timeCalculator(), this._filmStripView);
302 this._filmStripView.show(this.element, this.element.firstElementChil d); 302 this._filmStripView.show(this.contentElement, this._networkLogShowOv erviewSetting.get() ? this._overviewPane.element : this._splitWidget.element);
303 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameSelected, this._onFilmFrameSelected, this); 303 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameSelected, this._onFilmFrameSelected, this);
304 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameEnter, this._onFilmFrameEnter, this); 304 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameEnter, this._onFilmFrameEnter, this);
305 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameExit, this._onFilmFrameExit, this); 305 this._filmStripView.addEventListener(WebInspector.FilmStripView.Even ts.FrameExit, this._onFilmFrameExit, this);
306 this._resetFilmStripView(); 306 this._resetFilmStripView();
307 } 307 }
308 308
309 if (!toggled && this._filmStripRecorder) { 309 if (!toggled && this._filmStripRecorder) {
310 this._filmStripView.detach(); 310 this._filmStripView.detach();
311 this._filmStripView = null; 311 this._filmStripView = null;
312 this._filmStripRecorder = null; 312 this._filmStripRecorder = null;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 /** 509 /**
510 * @this {WebInspector.NetworkPanel} 510 * @this {WebInspector.NetworkPanel}
511 */ 511 */
512 function appendRevealItem(request) 512 function appendRevealItem(request)
513 { 513 {
514 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in N etwork ^panel"), reveal.bind(this, request)); 514 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in N etwork ^panel"), reveal.bind(this, request));
515 } 515 }
516 516
517 if (event.target.isSelfOrDescendant(this.element)) 517 if (event.target.isSelfOrDescendant(this.contentElement))
518 return; 518 return;
519 519
520 if (target instanceof WebInspector.Resource) { 520 if (target instanceof WebInspector.Resource) {
521 var resource = /** @type {!WebInspector.Resource} */ (target); 521 var resource = /** @type {!WebInspector.Resource} */ (target);
522 if (resource.request) 522 if (resource.request)
523 appendRevealItem.call(this, resource.request); 523 appendRevealItem.call(this, resource.request);
524 return; 524 return;
525 } 525 }
526 if (target instanceof WebInspector.UISourceCode) { 526 if (target instanceof WebInspector.UISourceCode) {
527 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target ); 527 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target );
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 * @return {boolean} 769 * @return {boolean}
770 */ 770 */
771 handleAction: function(context, actionId) 771 handleAction: function(context, actionId)
772 { 772 {
773 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); 773 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel);
774 console.assert(panel && panel instanceof WebInspector.NetworkPanel); 774 console.assert(panel && panel instanceof WebInspector.NetworkPanel);
775 panel._toggleRecording(); 775 panel._toggleRecording();
776 return true; 776 return true;
777 } 777 }
778 } 778 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698