Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / tracks / sample_track.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 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/tracks/rect_track.html">
9
10 <script>
11 'use strict';
12
13 tv.exportTo('tracing.tracks', function() {
14   /**
15    * A track that displays an array of Sample objects.
16    * @constructor
17    * @extends {HeadingTrack}
18    */
19   var SampleTrack = tv.ui.define(
20       'sample-track', tracing.tracks.RectTrack);
21
22   SampleTrack.prototype = {
23
24     __proto__: tracing.tracks.RectTrack.prototype,
25
26     decorate: function(viewport) {
27       tracing.tracks.RectTrack.prototype.decorate.call(this, viewport);
28     },
29
30     get samples() {
31       return this.rects;
32     },
33
34     set samples(samples) {
35       this.rects = samples;
36     },
37
38     addRectToSelection: function(sample, selection) {
39       selection.push(sample);
40     }
41   };
42
43   return {
44     SampleTrack: SampleTrack
45   };
46 });
47 </script>
48