blob: 8a5dd333ce6d8938acaf295529a797b699e8729c [file] [log] [blame]
Chris Craikbeca7ae2015-04-07 13:29:55 -07001<!DOCTYPE html>
2<!--
3Copyright (c) 2013 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/analysis_sub_view.html">
9<link rel="import" href="/core/analysis/single_event_sub_view.html">
Chris Craik44c28202015-05-12 17:25:16 -070010<link rel="import" href="/core/analysis/related_flows.html">
Chris Craikbeca7ae2015-04-07 13:29:55 -070011
12<polymer-element name="tv-c-a-single-thread-slice-sub-view"
13 extends="tracing-analysis-sub-view">
14 <template>
15 <style>
16 :host {
17 display: flex;
Chris Craik44c28202015-05-12 17:25:16 -070018 flex-direction: row;
Chris Craikbeca7ae2015-04-07 13:29:55 -070019 }
Chris Craik44c28202015-05-12 17:25:16 -070020 #flows {
21 display: flex;
22 flex-direction: column;
23 }
24
Chris Craikbeca7ae2015-04-07 13:29:55 -070025 </style>
26 <tv-c-a-single-event-sub-view id="content"></tv-c-a-single-event-sub-view>
Chris Craik44c28202015-05-12 17:25:16 -070027 <div id="flows">
28 <tv-c-a-related-flows id="rflows">
29 </tv-c-a-related-flows>
30 </div>
Chris Craikbeca7ae2015-04-07 13:29:55 -070031 </template>
32
33 <script>
34 'use strict';
35
36 Polymer({
37 get selection() {
38 return this.$.content.selection;
39 },
40
41 set selection(selection) {
42 this.$.content.selection = selection;
Chris Craik44c28202015-05-12 17:25:16 -070043 var hasFlows = false;
44 var slice;
45 if (selection) {
46 slice = selection[0];
47 hasFlows = slice.inFlowEvents.length !== 0 ||
48 slice.outFlowEvents.length !== 0;
49 }
50 if (hasFlows) {
51 this.$.rflows.style.display = '';
52 this.$.rflows.setFlows(
53 new tv.c.Selection(slice.inFlowEvents),
54 new tv.c.Selection(slice.outFlowEvents));
55 } else {
56 this.$.rflows.style.display = 'none';
57 this.$.rflows.clearFlows();
58 }
Chris Craikbeca7ae2015-04-07 13:29:55 -070059 }
60 });
61 </script>
Chris Craik44c28202015-05-12 17:25:16 -070062</polymer-element>