summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/tracing/tracing/value/ui/generic_diagnostic_span.html
blob: 502cf020362f51693ef06bd5762afff08199c8f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/ui/analysis/generic_object_view.html">

<polymer-element name="tr-v-ui-generic-diagnostic-span">
  <template>
    <tr-ui-a-generic-object-view id="generic"></tr-ui-a-generic-object-view>
  </template>

  <script>
  'use strict';
  Polymer({
    ready: function() {
      this.diagnostic_ = undefined;
    },

    get diagnostic() {
      return this.diagnostic_;
    },

    set diagnostic(d) {
      this.diagnostic_ = d;
      this.updateContents_();
    },

    updateContents_: function() {
      if (this.diagnostic === undefined) {
        this.$.generic.object = undefined;
        return;
      }

      this.$.generic.object = this.diagnostic.value;
    }
  });
  </script>
</polymer-element>