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

Unified Diff: tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html

Issue 3002973002: Refactor diagnostic spans to share a polymer behavior. (Closed)
Patch Set: Created 3 years, 4 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
Index: tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html
diff --git a/tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html b/tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html
index e5d96d2875a3435e953792cb6bc907fbb2838f92..374a403f613e65ef8489ae8e807b79bf303829b2 100644
--- a/tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html
+++ b/tracing/tracing/value/ui/unmergeable_diagnostic_set_span.html
@@ -12,32 +12,29 @@ found in the LICENSE file.
just not import anything.
-->
+<link rel="import" href="/tracing/value/ui/diagnostic_span_behavior.html">
+
<dom-module id="tr-v-ui-unmergeable-diagnostic-set-span">
- <script>
- 'use strict';
+</dom-module>
+
+<script>
+'use strict';
+tr.exportTo('tr.v.ui', function() {
Polymer({
is: 'tr-v-ui-unmergeable-diagnostic-set-span',
-
- ready() {
- this.diagnostic_ = undefined;
- },
-
- get diagnostic() {
- return this.diagnostic_;
- },
-
- set diagnostic(d) {
- this.diagnostic_ = d;
- this.updateContents_();
- },
+ behaviors: [tr.v.ui.DIAGNOSTIC_SPAN_BEHAVIOR],
updateContents_() {
Polymer.dom(this).textContent = '';
for (const diagnostic of this.diagnostic) {
- Polymer.dom(this).appendChild(tr.v.ui.createDiagnosticSpan(diagnostic));
- Polymer.dom(this).appendChild(document.createElement('br'));
+ const div = document.createElement('div');
+ div.appendChild(tr.v.ui.createDiagnosticSpan(
+ diagnostic, this.name_, this.histogram_));
+ Polymer.dom(this).appendChild(div);
}
}
});
- </script>
-</dom-module>
+
+ return {};
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698