blob: 5d2f8c71a0e27b77f1915e6d4806ed20fd1993b6 [file] [log] [blame]
<!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="tr-c-a-single-frame-sub-view"
extends="tr-c-a-sub-view">
<template>
<style>
:host {
display: flex;
flex-direction: column;
}
#asv {
flex: 0 0 auto;
align-self: stretch;
}
</style>
<tr-c-a-alert-sub-view id="asv">
</tr-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 tr.c.Selection(selection[0].associatedAlerts);
},
get relatedEventsToHighlight() {
if (!this.currentSelection_)
return undefined;
return new tr.c.Selection(this.currentSelection_[0].associatedEvents);
}
});
</script>
</polymer-element>