Chris Craik | b122baf | 2015-03-05 13:58:42 -0800 | [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/analysis_sub_view.html"> |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 9 | <link rel="import" href="/core/analysis/single_event_sub_view.html"> |
Chris Craik | b122baf | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 10 | |
| 11 | <polymer-element name="tv-c-single-interaction-record-sub-view" |
| 12 | extends="tracing-analysis-sub-view"> |
| 13 | <script> |
| 14 | 'use strict'; |
| 15 | |
| 16 | Polymer({ |
| 17 | created: function() { |
| 18 | this.currentSelection_ = undefined; |
| 19 | }, |
| 20 | |
| 21 | set selection(selection) { |
| 22 | this.textContent = ''; |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 23 | var realView = document.createElement('tv-c-a-single-event-sub-view'); |
Chris Craik | b122baf | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 24 | |
| 25 | this.appendChild(realView); |
| 26 | realView.setSelectionWithoutErrorChecks(selection); |
| 27 | |
| 28 | this.currentSelection_ = selection; |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 29 | }, |
| 30 | |
| 31 | get relatedEventsToHighlight() { |
| 32 | if (!this.currentSelection_) |
| 33 | return undefined; |
| 34 | return new tv.c.Selection(this.currentSelection_[0].associatedEvents); |
Chris Craik | b122baf | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 35 | } |
| 36 | }); |
| 37 | </script> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 38 | </polymer-element> |