OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/ui/base/deep_utils.html"> | 8 <link rel="import" href="/tracing/ui/base/deep_utils.html"> |
9 <link rel="import" href="/tracing/value/diagnostics/diagnostic.html"> | 9 <link rel="import" href="/tracing/value/diagnostics/diagnostic.html"> |
10 <link rel="import" href="/tracing/value/ui/breakdown_span.html"> | 10 <link rel="import" href="/tracing/value/ui/breakdown_span.html"> |
11 <link rel="import" href="/tracing/value/ui/collected_related_event_set_span.html
"> | 11 <link rel="import" href="/tracing/value/ui/collected_related_event_set_span.html
"> |
12 <link rel="import" href="/tracing/value/ui/date_range_span.html"> | 12 <link rel="import" href="/tracing/value/ui/date_range_span.html"> |
13 <link rel="import" href="/tracing/value/ui/generic_set_span.html"> | 13 <link rel="import" href="/tracing/value/ui/generic_set_span.html"> |
14 <link rel="import" href="/tracing/value/ui/related_event_set_span.html"> | 14 <link rel="import" href="/tracing/value/ui/related_event_set_span.html"> |
15 <link rel="import" href="/tracing/value/ui/related_histogram_map_span.html"> | |
16 <link rel="import" href="/tracing/value/ui/scalar_diagnostic_span.html"> | 15 <link rel="import" href="/tracing/value/ui/scalar_diagnostic_span.html"> |
17 <link rel="import" href="/tracing/value/ui/tag_map_span.html"> | 16 <link rel="import" href="/tracing/value/ui/tag_map_span.html"> |
18 <link rel="import" href="/tracing/value/ui/unmergeable_diagnostic_set_span.html"
> | 17 <link rel="import" href="/tracing/value/ui/unmergeable_diagnostic_set_span.html"
> |
19 | 18 |
20 <script> | 19 <script> |
21 'use strict'; | 20 'use strict'; |
22 tr.exportTo('tr.v.ui', function() { | 21 tr.exportTo('tr.v.ui', function() { |
23 /** | 22 /** |
24 * Find the name of a polymer element registered to display |diagnostic| | 23 * Find the name of a polymer element registered to display |diagnostic| |
25 * or one of its base classes. | 24 * or one of its base classes. |
(...skipping 27 matching lines...) Expand all Loading... |
53 } | 52 } |
54 | 53 |
55 /** | 54 /** |
56 * Create a visualization for |diagnostic|. | 55 * Create a visualization for |diagnostic|. |
57 * | 56 * |
58 * @param {!tr.v.d.Diagnostic} diagnostic | 57 * @param {!tr.v.d.Diagnostic} diagnostic |
59 * @param {string} name | 58 * @param {string} name |
60 * @param {!tr.v.Histogram} histogram | 59 * @param {!tr.v.Histogram} histogram |
61 * @return {Element} | 60 * @return {Element} |
62 */ | 61 */ |
63 function createDiagnosticSpan(diagnostic, name, histogram) { | 62 function createDiagnosticSpan(diagnostic, name, histogram, histograms) { |
64 const tagName = findElementNameForDiagnostic(diagnostic); | 63 const tagName = findElementNameForDiagnostic(diagnostic); |
65 const span = document.createElement(tagName); | 64 const span = document.createElement(tagName); |
66 if (span.build === undefined) throw new Error(tagName); | 65 if (span.build === undefined) throw new Error(tagName); |
67 span.build(diagnostic, name, histogram); | 66 span.build(diagnostic, name, histogram, histograms); |
68 return span; | 67 return span; |
69 } | 68 } |
70 | 69 |
71 return { | 70 return { |
72 createDiagnosticSpan, | 71 createDiagnosticSpan, |
73 }; | 72 }; |
74 }); | 73 }); |
75 </script> | 74 </script> |
OLD | NEW |