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="/tracing/base/iteration_helpers.html"> 9 <link rel="import" href="/tracing/ui/analysis/alert_sub_view.html"> 10 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> 11 12 <dom-module id='tr-ui-a-single-frame-sub-view'> 13 <template> 14 <style> 15 :host { 16 display: flex; 17 flex-direction: column; 18 } 19 #asv { 20 flex: 0 0 auto; 21 align-self: stretch; 22 } 23 </style> 24 <tr-ui-a-alert-sub-view id="asv"> 25 </tr-ui-a-alert-sub-view> 26 </template> 27 </dom-module> 28 <script> 29 'use strict'; 30 31 Polymer({ 32 is: 'tr-ui-a-single-frame-sub-view', 33 behaviors: [tr.ui.analysis.AnalysisSubView], 34 35 ready: function() { 36 this.currentSelection_ = undefined; 37 }, 38 39 get selection() { 40 return this.currentSelection_; 41 }, 42 43 set selection(selection) { 44 this.currentSelection_ = selection; 45 this.$.asv.selection = tr.b.getOnlyElement(selection).associatedAlerts; 46 }, 47 48 get relatedEventsToHighlight() { 49 if (!this.currentSelection_) 50 return undefined; 51 return tr.b.getOnlyElement(this.currentSelection_).associatedEvents; 52 } 53 }); 54 55 tr.ui.analysis.AnalysisSubView.register( 56 'tr-ui-a-single-frame-sub-view', 57 tr.model.Frame, 58 { 59 multi: false, 60 title: 'Frame', 61 }); 62 </script> 63