| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 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/analysis/multi_event_sub_view.html"> | 10 <link rel="import" href="/tracing/ui/analysis/multi_event_sub_view.html"> |
| 11 | 11 |
| 12 <script> | 12 <script> |
| 13 'use strict'; | 13 'use strict'; |
| 14 | 14 |
| 15 Polymer({ | 15 Polymer({ |
| 16 is: 'tr-ui-a-multi-frame-sub-view', | 16 is: 'tr-ui-a-multi-frame-sub-view', |
| 17 behaviors: [Catapult.tr_ui_a_sub_view_behavior], | 17 behaviors: [Catapult.tr_ui_a_sub_view_behavior], |
| 18 | 18 |
| 19 created: function() { | 19 created: function() { |
| 20 this.currentSelection_ = undefined; | 20 this.currentSelection_ = undefined; |
| 21 }, | 21 }, |
| 22 | 22 |
| 23 // TODO(polymer): Convert to Polymer property. | 23 // TODO(polymer): Convert to Polymer property. |
| 24 set selection(selection) { | 24 set selection(selection) { |
| 25 this.textContent = ''; | 25 this.textContent = ''; |
| 26 var realView = document.createElement('tr-ui-a-multi-event-sub-view'); | 26 var realView = document.createElement('tr-ui-a-multi-event-sub-view'); |
| 27 realView.eventsHaveDuration = false; | 27 realView.eventsHaveDuration = false; |
| 28 realView.eventsHaveSubRows = false; | 28 realView.eventsHaveSubRows = false; |
| 29 | 29 |
| 30 this.appendChild(realView); | 30 Polymer.dom(this).appendChild(realView); |
| 31 realView.setSelectionWithoutErrorChecks(selection); | 31 realView.setSelectionWithoutErrorChecks(selection); |
| 32 | 32 |
| 33 this.currentSelection_ = selection; | 33 this.currentSelection_ = selection; |
| 34 }, | 34 }, |
| 35 | 35 |
| 36 get selection() { | 36 get selection() { |
| 37 return this.currentSelection_; | 37 return this.currentSelection_; |
| 38 }, | 38 }, |
| 39 | 39 |
| 40 get relatedEventsToHighlight() { | 40 get relatedEventsToHighlight() { |
| 41 if (!this.currentSelection_) | 41 if (!this.currentSelection_) |
| 42 return undefined; | 42 return undefined; |
| 43 var selection = new tr.model.EventSet(); | 43 var selection = new tr.model.EventSet(); |
| 44 this.currentSelection_.forEach(function(frameEvent) { | 44 this.currentSelection_.forEach(function(frameEvent) { |
| 45 frameEvent.associatedEvents.forEach(function(event) { | 45 frameEvent.associatedEvents.forEach(function(event) { |
| 46 selection.push(event); | 46 selection.push(event); |
| 47 }); | 47 }); |
| 48 }); | 48 }); |
| 49 return selection; | 49 return selection; |
| 50 } | 50 } |
| 51 }); | 51 }); |
| 52 </script> | 52 </script> |
| OLD | NEW |