| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 2015 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/model/event_set.html"> | 8 <link rel="import" href="/tracing/model/event_set.html"> |
| 9 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> | 9 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> |
| 10 <link rel="import" href="/tracing/ui/base/table.html"> | 10 <link rel="import" href="/tracing/ui/base/table.html"> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 </style> | 78 </style> |
| 79 <tr-ui-a-power-sample-table id="samplesTable"> | 79 <tr-ui-a-power-sample-table id="samplesTable"> |
| 80 </tr-ui-a-power-sample-table> | 80 </tr-ui-a-power-sample-table> |
| 81 </template> | 81 </template> |
| 82 </dom-module> | 82 </dom-module> |
| 83 <script> | 83 <script> |
| 84 'use strict'; | 84 'use strict'; |
| 85 | 85 |
| 86 Polymer({ | 86 Polymer({ |
| 87 is: 'tr-ui-a-single-power-sample-sub-view', | 87 is: 'tr-ui-a-single-power-sample-sub-view', |
| 88 behaviors: [tr.ui.analysis.behaviors.AnalysisSubView], | 88 behaviors: [tr.ui.analysis.AnalysisSubView], |
| 89 | 89 |
| 90 ready: function() { | 90 ready: function() { |
| 91 this.currentSelection_ = undefined; | 91 this.currentSelection_ = undefined; |
| 92 }, | 92 }, |
| 93 | 93 |
| 94 get selection() { | 94 get selection() { |
| 95 return this.currentSelection_; | 95 return this.currentSelection_; |
| 96 }, | 96 }, |
| 97 | 97 |
| 98 set selection(selection) { | 98 set selection(selection) { |
| 99 this.currentSelection_ = selection; | 99 this.currentSelection_ = selection; |
| 100 this.updateContents_(); | 100 this.updateContents_(); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 updateContents_: function() { | 103 updateContents_: function() { |
| 104 if (this.selection.length != 1) | 104 if (this.selection.length != 1) |
| 105 throw 'Cannot pass multiple samples to sample table.'; | 105 throw 'Cannot pass multiple samples to sample table.'; |
| 106 this.$.samplesTable.sample = tr.b.getOnlyElement(this.selection); | 106 this.$.samplesTable.sample = tr.b.getOnlyElement(this.selection); |
| 107 } | 107 } |
| 108 }); | 108 }); |
| 109 </script> | 109 </script> |
| OLD | NEW |