Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | Copyright (c) 2013 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/analysis_sub_view.html"> |
| 9 | <link rel="import" href="/core/analysis/single_event_sub_view.html"> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 10 | <link rel="import" href="/core/analysis/related_flows.html"> |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 11 | |
| 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 Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 18 | flex-direction: row; |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 19 | } |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 20 | #flows { |
| 21 | display: flex; |
| 22 | flex-direction: column; |
| 23 | } |
| 24 | |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 25 | </style> |
| 26 | <tv-c-a-single-event-sub-view id="content"></tv-c-a-single-event-sub-view> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 27 | <div id="flows"> |
| 28 | <tv-c-a-related-flows id="rflows"> |
| 29 | </tv-c-a-related-flows> |
| 30 | </div> |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 31 | </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 Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 43 | 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 Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 59 | } |
| 60 | }); |
| 61 | </script> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 62 | </polymer-element> |