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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js

Issue 2614833002: DevTools: Do not show network pane on Timeline when there're no network activity (Closed)
Patch Set: addressing comment Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js ('k') | 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 /** 5 /**
6 * @implements {UI.FlameChartDataProvider} 6 * @implements {UI.FlameChartDataProvider}
7 * @unrestricted 7 * @unrestricted
8 */ 8 */
9 Timeline.TimelineFlameChartNetworkDataProvider = class { 9 Timeline.TimelineFlameChartNetworkDataProvider = class {
10 /** 10 /**
11 * @param {!TimelineModel.TimelineModel} model 11 * @param {!TimelineModel.TimelineModel} model
12 */ 12 */
13 constructor(model) { 13 constructor(model) {
14 this.reset();
15 this._font = '11px ' + Host.fontFamily(); 14 this._font = '11px ' + Host.fontFamily();
16 this._model = model; 15 this._model = model;
17 var loadingCategory = Timeline.TimelineUIUtils.categories()['loading']; 16 this.reset();
18 this._waitingColor = loadingCategory.childColor;
19 this._processingColor = loadingCategory.color;
20
21 this._style = { 17 this._style = {
22 padding: 4, 18 padding: 4,
23 height: 17, 19 height: 17,
24 collapsible: true, 20 collapsible: true,
25 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round), 21 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg round),
26 font: this._font, 22 font: this._font,
27 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background), 23 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color Usage.Background),
28 nestingLevel: 0, 24 nestingLevel: 0,
29 useFirstLineForOverview: false, 25 useFirstLineForOverview: false,
30 shareHeaderLine: false 26 shareHeaderLine: false
31 }; 27 };
32 this._group = {startLevel: 0, name: Common.UIString('Network'), expanded: tr ue, style: this._style}; 28 this._group = {startLevel: 0, name: Common.UIString('Network'), expanded: tr ue, style: this._style};
33 } 29 }
34 30
35 /** 31 /**
32 * @return {boolean}
33 */
34 isEmpty() {
35 this.timelineData();
36 return this._maxLevel === 0;
37 }
38
39 /**
36 * @override 40 * @override
37 * @return {number} 41 * @return {number}
38 */ 42 */
39 maxStackDepth() { 43 maxStackDepth() {
40 return this._maxLevel; 44 return this._maxLevel;
41 } 45 }
42 46
43 /** 47 /**
44 * @override 48 * @override
45 * @return {!UI.FlameChart.TimelineData} 49 * @return {!UI.FlameChart.TimelineData}
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 this._requests.push(request); 346 this._requests.push(request);
343 this._timelineData.entryStartTimes.push(request.startTime); 347 this._timelineData.entryStartTimes.push(request.startTime);
344 this._timelineData.entryTotalTimes.push(request.endTime - request.startTime) ; 348 this._timelineData.entryTotalTimes.push(request.endTime - request.startTime) ;
345 this._timelineData.entryLevels.push(this._requests.length - 1); 349 this._timelineData.entryLevels.push(this._requests.length - 1);
346 } 350 }
347 351
348 /** 352 /**
349 * @return {number} 353 * @return {number}
350 */ 354 */
351 preferredHeight() { 355 preferredHeight() {
352 return this._style.height * (this._group.expanded ? Number.constrain(this._m axLevel + 1, 4, 8) : 2); 356 return this._style.height * (this._group.expanded ? Number.constrain(this._m axLevel + 1, 4, 8.5) : 1);
353 } 357 }
354 358
355 /** 359 /**
356 * @override 360 * @override
357 * @param {number} value 361 * @param {number} value
358 * @param {number=} precision 362 * @param {number=} precision
359 * @return {string} 363 * @return {string}
360 */ 364 */
361 formatValue(value, precision) { 365 formatValue(value, precision) {
362 return Number.preciseMillisToString(value, precision); 366 return Number.preciseMillisToString(value, precision);
363 } 367 }
364 368
365 /** 369 /**
366 * @override 370 * @override
367 * @param {number} entryIndex 371 * @param {number} entryIndex
368 * @return {boolean} 372 * @return {boolean}
369 */ 373 */
370 canJumpToEntry(entryIndex) { 374 canJumpToEntry(entryIndex) {
371 return false; 375 return false;
372 } 376 }
373 }; 377 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698