| <!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="/ui/base/draw_helpers.html"> |
| <link rel="import" href="/ui/base/ui.html"> |
| <link rel="import" href="/ui/tracks/alert_track.html"> |
| <link rel="import" href="/ui/tracks/container_track.html"> |
| <link rel="import" href="/ui/tracks/drawing_container.html"> |
| <link rel="import" href="/ui/tracks/highlighter.html"> |
| <link rel="import" href="/ui/tracks/kernel_track.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.exportTo('tr.ui.tracks', function() { |
| /** |
| * A track that displays an array of interaction records. |
| * @constructor |
| * @extends {MultiRowTrack} |
| */ |
| var InteractionTrack = tr.ui.b.define( |
| 'interaction-track', tr.ui.tracks.MultiRowTrack); |
| |
| InteractionTrack.prototype = { |
| __proto__: tr.ui.tracks.MultiRowTrack.prototype, |
| |
| decorate: function(viewport) { |
| tr.ui.tracks.MultiRowTrack.prototype.decorate.call(this, viewport); |
| this.heading = 'Interactions'; |
| this.subRows_ = []; |
| }, |
| |
| set model(model) { |
| this.setItemsToGroup(model.interaction_records, { |
| guid: tr.b.GUID.allocate(), |
| model: model, |
| getSettingsKey: function() { |
| return undefined; |
| } |
| }); |
| }, |
| |
| buildSubRows_: function(slices) { |
| if (this.subRows_.length) |
| return this.subRows_; |
| this.subRows_.push.apply(this.subRows_, |
| tr.ui.tracks.AsyncSliceGroupTrack.prototype.buildSubRows_.call( |
| {}, slices, true)); |
| return this.subRows_; |
| }, |
| |
| addSubTrack_: function(slices) { |
| var track = new tr.ui.tracks.SliceTrack(this.viewport); |
| track.slices = slices; |
| this.appendChild(track); |
| return track; |
| } |
| }; |
| |
| return { |
| InteractionTrack: InteractionTrack |
| }; |
| }); |
| </script> |