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

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

Issue 2466413007: [Devtools] Moved new timeline canvas context menu to bottom (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 WebInspector.NetworkLogViewColumns = class { 7 WebInspector.NetworkLogViewColumns = class {
8 /** 8 /**
9 * @param {!WebInspector.NetworkLogView} networkLogView 9 * @param {!WebInspector.NetworkLogView} networkLogView
10 * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator 10 * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 fragment.createTextChild(title); 485 fragment.createTextChild(title);
486 var subtitleDiv = fragment.createChild('div', 'network-header-subtitle'); 486 var subtitleDiv = fragment.createChild('div', 'network-header-subtitle');
487 subtitleDiv.createTextChild(subtitle); 487 subtitleDiv.createTextChild(subtitle);
488 return fragment; 488 return fragment;
489 } 489 }
490 490
491 /** 491 /**
492 * @param {!WebInspector.ContextMenu} contextMenu 492 * @param {!WebInspector.ContextMenu} contextMenu
493 */ 493 */
494 _innerHeaderContextMenu(contextMenu) { 494 _innerHeaderContextMenu(contextMenu) {
495 var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideab le);
496 var nonResponseHeaders = columnConfigs.filter(columnConfig => !columnConfig. isResponseHeader);
497 for (var columnConfig of nonResponseHeaders)
498 contextMenu.appendCheckboxItem(
499 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
500
501 contextMenu.appendSeparator();
502
503 var responseSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('R esponse Headers'));
504 var responseHeaders = columnConfigs.filter(columnConfig => columnConfig.isRe sponseHeader);
505 for (var columnConfig of responseHeaders)
506 responseSubMenu.appendCheckboxItem(
507 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
508
509 responseSubMenu.appendSeparator();
510 responseSubMenu.appendItem(
511 WebInspector.UIString('Manage Header Columns\u2026'), this._manageCustom HeaderDialog.bind(this));
512
495 if (Runtime.experiments.isEnabled('canvasNetworkTimeline')) { 513 if (Runtime.experiments.isEnabled('canvasNetworkTimeline')) {
514 contextMenu.appendSeparator();
496 var timelineSortIds = WebInspector.NetworkLogViewColumns.TimelineSortIds; 515 var timelineSortIds = WebInspector.NetworkLogViewColumns.TimelineSortIds;
497 var timelineSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString( 'Timeline')); 516 var timelineSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString( 'Timeline'));
498 timelineSubMenu.appendCheckboxItem( 517 timelineSubMenu.appendCheckboxItem(
499 WebInspector.UIString('Start Time'), setTimelineMode.bind(this, timeli neSortIds.StartTime), 518 WebInspector.UIString('Start Time'), setTimelineMode.bind(this, timeli neSortIds.StartTime),
500 this._activeTimelineSortId === timelineSortIds.StartTime); 519 this._activeTimelineSortId === timelineSortIds.StartTime);
501 timelineSubMenu.appendCheckboxItem( 520 timelineSubMenu.appendCheckboxItem(
502 WebInspector.UIString('Response Time'), setTimelineMode.bind(this, tim elineSortIds.ResponseTime), 521 WebInspector.UIString('Response Time'), setTimelineMode.bind(this, tim elineSortIds.ResponseTime),
503 this._activeTimelineSortId === timelineSortIds.ResponseTime); 522 this._activeTimelineSortId === timelineSortIds.ResponseTime);
504 timelineSubMenu.appendCheckboxItem( 523 timelineSubMenu.appendCheckboxItem(
505 WebInspector.UIString('End Time'), setTimelineMode.bind(this, timeline SortIds.EndTime), 524 WebInspector.UIString('End Time'), setTimelineMode.bind(this, timeline SortIds.EndTime),
506 this._activeTimelineSortId === timelineSortIds.EndTime); 525 this._activeTimelineSortId === timelineSortIds.EndTime);
507 timelineSubMenu.appendCheckboxItem( 526 timelineSubMenu.appendCheckboxItem(
508 WebInspector.UIString('Total Duration'), setTimelineMode.bind(this, ti melineSortIds.Duration), 527 WebInspector.UIString('Total Duration'), setTimelineMode.bind(this, ti melineSortIds.Duration),
509 this._activeTimelineSortId === timelineSortIds.Duration); 528 this._activeTimelineSortId === timelineSortIds.Duration);
510 timelineSubMenu.appendCheckboxItem( 529 timelineSubMenu.appendCheckboxItem(
511 WebInspector.UIString('Latency'), setTimelineMode.bind(this, timelineS ortIds.Latency), 530 WebInspector.UIString('Latency'), setTimelineMode.bind(this, timelineS ortIds.Latency),
512 this._activeTimelineSortId === timelineSortIds.Latency); 531 this._activeTimelineSortId === timelineSortIds.Latency);
513 contextMenu.appendSeparator();
514 } 532 }
515 var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideab le);
516 var nonResponseHeaders = columnConfigs.filter(columnConfig => !columnConfig. isResponseHeader);
517 for (var columnConfig of nonResponseHeaders)
518 contextMenu.appendCheckboxItem(
519 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
520
521 contextMenu.appendSeparator();
522
523 var responseSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('R esponse Headers'));
524 var responseHeaders = columnConfigs.filter(columnConfig => columnConfig.isRe sponseHeader);
525 for (var columnConfig of responseHeaders)
526 responseSubMenu.appendCheckboxItem(
527 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
528
529 responseSubMenu.appendSeparator();
530 responseSubMenu.appendItem(
531 WebInspector.UIString('Manage Header Columns\u2026'), this._manageCustom HeaderDialog.bind(this));
532 533
533 contextMenu.show(); 534 contextMenu.show();
534 535
535 /** 536 /**
536 * @param {!WebInspector.NetworkLogViewColumns.TimelineSortIds} sortId 537 * @param {!WebInspector.NetworkLogViewColumns.TimelineSortIds} sortId
537 * @this {WebInspector.NetworkLogViewColumns} 538 * @this {WebInspector.NetworkLogViewColumns}
538 */ 539 */
539 function setTimelineMode(sortId) { 540 function setTimelineMode(sortId) {
540 var calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColum ns._calculatorTypes.Time); 541 var calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColum ns._calculatorTypes.Time);
541 var timelineSortIds = WebInspector.NetworkLogViewColumns.TimelineSortIds; 542 var timelineSortIds = WebInspector.NetworkLogViewColumns.TimelineSortIds;
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 /** 1070 /**
1070 * @enum {string} 1071 * @enum {string}
1071 */ 1072 */
1072 WebInspector.NetworkLogViewColumns.TimelineSortIds = { 1073 WebInspector.NetworkLogViewColumns.TimelineSortIds = {
1073 StartTime: 'startTime', 1074 StartTime: 'startTime',
1074 ResponseTime: 'responseReceivedTime', 1075 ResponseTime: 'responseReceivedTime',
1075 EndTime: 'endTime', 1076 EndTime: 'endTime',
1076 Duration: 'duration', 1077 Duration: 'duration',
1077 Latency: 'latency' 1078 Latency: 'latency'
1078 }; 1079 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698