| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <!-- | |
| 3 Copyright 2017 The Chromium Authors. All rights reserved. | |
| 4 Use of this source code is governed by a BSD-style license that can be | |
| 5 found in the LICENSE file. | |
| 6 --> | |
| 7 | |
| 8 <link rel="import" href="/tracing/ui/base/table.html"> | |
| 9 | |
| 10 <dom-module id="tr-v-ui-merged-device-info-span"> | |
| 11 <template> | |
| 12 <tr-ui-b-table id="table"></tr-ui-b-table> | |
| 13 </template> | |
| 14 </dom-module> | |
| 15 <script> | |
| 16 'use strict'; | |
| 17 Polymer({ | |
| 18 is: 'tr-v-ui-merged-device-info-span', | |
| 19 | |
| 20 ready() { | |
| 21 this.diagnostic_ = undefined; | |
| 22 this.$.table.showHeader = false; | |
| 23 this.$.table.tableColumns = [ | |
| 24 {value: row => row[0]}, | |
| 25 {value: row => row[1]}, | |
| 26 ]; | |
| 27 }, | |
| 28 | |
| 29 get diagnostic() { | |
| 30 return this.diagnostic_; | |
| 31 }, | |
| 32 | |
| 33 set diagnostic(d) { | |
| 34 this.diagnostic_ = d; | |
| 35 this.updateContents_(); | |
| 36 }, | |
| 37 | |
| 38 updateContents_() { | |
| 39 if (this.diagnostic === undefined) { | |
| 40 this.$.table.tableRows = []; | |
| 41 return; | |
| 42 } | |
| 43 | |
| 44 const rows = []; | |
| 45 | |
| 46 if (this.diagnostic.chromeVersions.size) { | |
| 47 rows.push([ | |
| 48 'chrome versions', | |
| 49 Array.from(this.diagnostic.chromeVersions).join(', ') | |
| 50 ]); | |
| 51 } | |
| 52 if (this.diagnostic.osNames.size) { | |
| 53 rows.push([ | |
| 54 'os names', | |
| 55 Array.from(this.diagnostic.osNames).join(', ') | |
| 56 ]); | |
| 57 } | |
| 58 if (this.diagnostic.osVersions.size) { | |
| 59 rows.push([ | |
| 60 'os versions', | |
| 61 Array.from(this.diagnostic.osVersions).join(', ') | |
| 62 ]); | |
| 63 } | |
| 64 this.$.table.tableRows = rows; | |
| 65 } | |
| 66 }); | |
| 67 </script> | |
| OLD | NEW |