| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/core/analysis/analysis_sub_view.html"> |
| <link rel="import" href="/core/analysis/alert_sub_view.html"> |
| |
| <polymer-element name="tv-c-single-frame-sub-view" |
| extends="tracing-analysis-sub-view"> |
| <template> |
| <style> |
| :host { |
| display: flex; |
| flex-direction: column; |
| } |
| #asv { |
| flex: 0 0 auto; |
| align-self: stretch; |
| } |
| </style> |
| <tv-c-a-alert-sub-view id="asv"> |
| </tv-c-a-alert-sub-view> |
| </template> |
| <script> |
| 'use strict'; |
| |
| Polymer({ |
| ready: function() { |
| this.currentSelection_ = undefined; |
| }, |
| |
| get selection() { |
| return this.currentSelection_; |
| }, |
| |
| set selection(selection) { |
| if (selection.length != 1) |
| throw new Error('Only supports single frame!'); |
| this.currentSelection_ = selection; |
| this.$.asv.selection = new tv.c.Selection(selection[0].associatedAlerts); |
| }, |
| |
| get relatedEventsToHighlight() { |
| if (!this.currentSelection_) |
| return undefined; |
| return new tv.c.Selection(this.currentSelection_[0].associatedEvents); |
| } |
| }); |
| </script> |
| </polymer-element> |