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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 1314393003: DevTools: Opened screenshot view is seen chopped in "Summery" section of Timeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 WebInspector.TimelineUIUtils.generateDetailsContentForFrame = function(frameMode l, frame, filmStripFrame) 1449 WebInspector.TimelineUIUtils.generateDetailsContentForFrame = function(frameMode l, frame, filmStripFrame)
1450 { 1450 {
1451 var pieChart = WebInspector.TimelineUIUtils.generatePieChart(frame.timeByCat egory); 1451 var pieChart = WebInspector.TimelineUIUtils.generatePieChart(frame.timeByCat egory);
1452 var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null , null, false); 1452 var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null , null, false);
1453 var duration = WebInspector.TimelineUIUtils.frameDuration(frame); 1453 var duration = WebInspector.TimelineUIUtils.frameDuration(frame);
1454 contentHelper.appendElementRow(WebInspector.UIString("Duration"), duration, frame.hasWarnings()); 1454 contentHelper.appendElementRow(WebInspector.UIString("Duration"), duration, frame.hasWarnings());
1455 if (filmStripFrame) { 1455 if (filmStripFrame) {
1456 var filmStripPreview = createElementWithClass("img", "timeline-filmstrip -preview"); 1456 var filmStripPreview = createElementWithClass("img", "timeline-filmstrip -preview");
1457 filmStripFrame.imageDataPromise().then(onGotImageData.bind(null, filmStr ipPreview)); 1457 filmStripFrame.imageDataPromise().then(onGotImageData.bind(null, filmStr ipPreview));
1458 contentHelper.appendElementRow(WebInspector.UIString("Screenshot"), film StripPreview); 1458 contentHelper.appendElementRow(WebInspector.UIString("Screenshot"), film StripPreview);
1459 filmStripPreview.addEventListener("click", filmStripClicked.bind(null, f ilmStripFrame), false); 1459 filmStripPreview.addEventListener("click", frameClicked.bind(null, filmS tripFrame), false);
1460 } 1460 }
1461 var durationInMillis = frame.endTime - frame.startTime; 1461 var durationInMillis = frame.endTime - frame.startTime;
1462 contentHelper.appendTextRow(WebInspector.UIString("FPS"), Math.floor(1000 / durationInMillis)); 1462 contentHelper.appendTextRow(WebInspector.UIString("FPS"), Math.floor(1000 / durationInMillis));
1463 contentHelper.appendTextRow(WebInspector.UIString("CPU time"), Number.millis ToString(frame.cpuTime, true)); 1463 contentHelper.appendTextRow(WebInspector.UIString("CPU time"), Number.millis ToString(frame.cpuTime, true));
1464 contentHelper.appendElementRow(WebInspector.UIString("Aggregated Time"), pie Chart); 1464 contentHelper.appendElementRow(WebInspector.UIString("Aggregated Time"), pie Chart);
1465 if (Runtime.experiments.isEnabled("layersPanel") && frame.layerTree) { 1465 if (Runtime.experiments.isEnabled("layersPanel") && frame.layerTree) {
1466 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"), 1466 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"),
1467 WebInspector.Linkifier.linkifyUsingReveal er(frame.layerTree, WebInspector.UIString("show"))); 1467 WebInspector.Linkifier.linkifyUsingReveal er(frame.layerTree, WebInspector.UIString("show")));
1468 } 1468 }
1469 1469
1470 /** 1470 /**
1471 * @param {!Element} image 1471 * @param {!Element} image
1472 * @param {?string} data 1472 * @param {?string} data
1473 */ 1473 */
1474 function onGotImageData(image, data) 1474 function onGotImageData(image, data)
1475 { 1475 {
1476 if (data) 1476 if (data)
1477 image.src = "data:image/jpg;base64," + data; 1477 image.src = "data:image/jpg;base64," + data;
1478 } 1478 }
1479 1479
1480 /** 1480 /**
1481 * @param {!WebInspector.FilmStripModel.Frame} filmStripFrame 1481 * @param {!WebInspector.FilmStripModel.Frame} filmStripFrame
1482 */ 1482 */
1483 function filmStripClicked(filmStripFrame) 1483 function frameClicked(filmStripFrame)
1484 { 1484 {
1485 WebInspector.Dialog.show(null, new WebInspector.FilmStripView.DialogDele gate(filmStripFrame, 0)); 1485 new WebInspector.FilmStripView.DialogDelegate(filmStripFrame, 0);
1486 } 1486 }
1487 1487
1488 return contentHelper.element; 1488 return contentHelper.element;
1489 } 1489 }
1490 1490
1491 /** 1491 /**
1492 * @param {!WebInspector.TimelineFrame} frame 1492 * @param {!WebInspector.TimelineFrame} frame
1493 * @return {!Element} 1493 * @return {!Element}
1494 */ 1494 */
1495 WebInspector.TimelineUIUtils.frameDuration = function(frame) 1495 WebInspector.TimelineUIUtils.frameDuration = function(frame)
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 return; 1927 return;
1928 1928
1929 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace"); 1929 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace");
1930 1930
1931 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace); 1931 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace);
1932 1932
1933 stackTraceElement.appendChild(callFrameElem); 1933 stackTraceElement.appendChild(callFrameElem);
1934 } 1934 }
1935 1935
1936 } 1936 }
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