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/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.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/analysis/frame_power_usage_chart.html"> | 10 <link rel="import" href="/tracing/ui/analysis/frame_power_usage_chart.html"> |
(...skipping 24 matching lines...) Expand all Loading... |
35 </template> | 35 </template> |
36 </dom-module> | 36 </dom-module> |
37 | 37 |
38 <script> | 38 <script> |
39 'use strict'; | 39 'use strict'; |
40 | 40 |
41 // TODO(charliea): Add a dropdown that allows the user to select which type of | 41 // TODO(charliea): Add a dropdown that allows the user to select which type of |
42 // power sample analysis view they want (e.g. table of samples, graph). | 42 // power sample analysis view they want (e.g. table of samples, graph). |
43 Polymer({ | 43 Polymer({ |
44 is: 'tr-ui-a-multi-power-sample-sub-view', | 44 is: 'tr-ui-a-multi-power-sample-sub-view', |
45 behaviors: [tr.ui.analysis.behaviors.AnalysisSubView], | 45 behaviors: [tr.ui.analysis.AnalysisSubView], |
46 | 46 |
47 ready: function() { | 47 ready: function() { |
48 this.currentSelection_ = undefined; | 48 this.currentSelection_ = undefined; |
49 }, | 49 }, |
50 | 50 |
51 get selection() { | 51 get selection() { |
52 return this.currentSelection_; | 52 return this.currentSelection_; |
53 }, | 53 }, |
54 | 54 |
55 set selection(selection) { | 55 set selection(selection) { |
56 this.currentSelection_ = selection; | 56 this.currentSelection_ = selection; |
57 this.updateContents_(); | 57 this.updateContents_(); |
58 }, | 58 }, |
59 | 59 |
60 updateContents_: function() { | 60 updateContents_: function() { |
61 var samples = this.selection; | 61 var samples = this.selection; |
62 var vSyncTimestamps = (!samples ? [] : | 62 var vSyncTimestamps = (!samples ? [] : |
63 tr.b.getFirstElement(samples).series.device.vSyncTimestamps); | 63 tr.b.getFirstElement(samples).series.device.vSyncTimestamps); |
64 | 64 |
65 this.$.summaryTable.samples = samples; | 65 this.$.summaryTable.samples = samples; |
66 this.$.chart.setData(this.selection, vSyncTimestamps); | 66 this.$.chart.setData(this.selection, vSyncTimestamps); |
67 } | 67 } |
68 }); | 68 }); |
69 </script> | 69 </script> |
OLD | NEW |