blob: 5b3c9ea940343227cb81d5426967739fcc573885 [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/tracks/letter_dot_track.html">
<script>
'use strict';
tv.exportTo('tv.c.tracks', function() {
/**
* A track that displays an array of memoryDump objects.
* @constructor
* @extends {HeadingTrack}
*/
var MemoryDumpTrack = tv.b.ui.define(
'memory-dump-track', tv.c.tracks.LetterDotTrack);
MemoryDumpTrack.prototype = {
__proto__: tv.c.tracks.LetterDotTrack.prototype,
decorate: function(viewport) {
tv.c.tracks.LetterDotTrack.prototype.decorate.call(this, viewport);
this.heading = 'Memory dumps';
this.memoryDumps_ = undefined;
},
get memoryDumps() {
return this.memoryDumps_;
},
set memoryDumps(memoryDumps) {
this.memoryDumps_ = memoryDumps;
if (memoryDumps === undefined) {
this.items = undefined;
return;
}
var memoryColorId = tv.b.ui.getColorIdForReservedName('memory_dump');
this.items = this.memoryDumps_.map(function(memoryDump) {
return {
start: memoryDump.start,
get selected() {
return this.memoryDump.selected;
},
colorId: memoryColorId,
dotLetter: 'M',
memoryDump: memoryDump
};
});
},
getModelEventFromItem: function(item) {
return item.memoryDump;
}
};
return {
MemoryDumpTrack: MemoryDumpTrack
};
});
</script>