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

Unified Diff: Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js

Issue 343613004: Move needsPreviewElement to TimelineUIUtilsImple and make it private (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
diff --git a/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js b/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
index eb775f11ec50fe4d8f269d5da7399b02455f55e4..bcf95f52e3df2dc9e0a8ed2f8c3cfdcf8821df7d 100644
--- a/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
+++ b/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
@@ -266,6 +266,26 @@ WebInspector.TimelineUIUtilsImpl.buildDetailsNode = function(record, linkifier,
}
/**
+ * @param {string=} recordType
+ * @return {boolean}
+ */
+WebInspector.TimelineUIUtilsImpl._needsPreviewElement = function(recordType)
+{
+ if (!recordType)
+ return false;
+ const recordTypes = WebInspector.TimelineModel.RecordType;
+ switch (recordType) {
+ case recordTypes.ResourceSendRequest:
+ case recordTypes.ResourceReceiveResponse:
+ case recordTypes.ResourceReceivedData:
+ case recordTypes.ResourceFinish:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
* @param {!WebInspector.TimelineModel.Record} record
* @param {!WebInspector.TimelineModel} model
* @param {!WebInspector.Linkifier} linkifier
@@ -278,7 +298,7 @@ WebInspector.TimelineUIUtilsImpl.generateDetailsContent = function(record, model
var relatedNode = null;
var recordData = record.data();
var barrier = new CallbackBarrier();
- if (!imageElement && WebInspector.TimelineUIUtils.needsPreviewElement(record.type()))
+ if (!imageElement && WebInspector.TimelineUIUtilsImpl._needsPreviewElement(record.type()))
WebInspector.DOMPresentationUtils.buildImagePreviewContents(record.target(), recordData["url"], false, barrier.createCallback(saveImage));
if (recordData["backendNodeId"])
record.target().domModel.pushNodesByBackendIdsToFrontend([recordData["backendNodeId"]], barrier.createCallback(setRelatedNode));
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698