blob: 46be4550684100e958c2e5a8c688b1fb49ce2b58 [file] [log] [blame]
Chris Craikbeca7ae2015-04-07 13:29:55 -07001<!DOCTYPE html>
2<!--
3Copyright (c) 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found 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 Craik44c28202015-05-12 17:25:16 -070036 },
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 Craikbeca7ae2015-04-07 13:29:55 -070048 }
49 });
50 </script>
Chris Craik44c28202015-05-12 17:25:16 -070051</polymer-element>