Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 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 |
| 5 | found in the LICENSE file. |
| 6 | --> |
| 7 | |
| 8 | <link rel="import" href="/core/analysis/multi_event_sub_view.html"> |
| 9 | <link rel="import" href="/core/analysis/analysis_sub_view.html"> |
| 10 | <link rel="import" href="/core/analysis/util.html"> |
| 11 | |
| 12 | <polymer-element name="tv-c-multi-frame-sub-view" |
| 13 | extends="tracing-analysis-sub-view"> |
| 14 | <script> |
| 15 | 'use strict'; |
| 16 | |
| 17 | Polymer({ |
| 18 | created: function() { |
| 19 | this.currentSelection_ = undefined; |
| 20 | }, |
| 21 | |
| 22 | set selection(selection) { |
| 23 | this.textContent = ''; |
| 24 | var realView = document.createElement('tv-c-a-multi-event-sub-view'); |
| 25 | realView.eventsHaveDuration = false; |
| 26 | realView.eventsHaveSubRows = false; |
| 27 | |
| 28 | this.appendChild(realView); |
| 29 | realView.setSelectionWithoutErrorChecks(selection); |
| 30 | |
| 31 | this.currentSelection_ = selection; |
| 32 | }, |
| 33 | |
| 34 | get selection() { |
| 35 | return this.currentSelection_; |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 36 | }, |
| 37 | |
| 38 | get relatedEventsToHighlight() { |
| 39 | if (!this.currentSelection_) |
| 40 | return undefined; |
| 41 | var selection = new tv.c.Selection(); |
| 42 | this.currentSelection_.forEach(function(frameEvent) { |
| 43 | frameEvent.associatedEvents.forEach(function(event) { |
| 44 | selection.push(event); |
| 45 | }); |
| 46 | }); |
| 47 | return selection; |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 48 | } |
| 49 | }); |
| 50 | </script> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 51 | </polymer-element> |