blob: 3143d8e9292abdf331a1e8fbbbc584dbd4007471 [file] [log] [blame]
Chris Craikf516a622015-04-01 17:52:39 -07001<!DOCTYPE html>
2<!--
3Copyright (c) 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/core/trace_model/annotation.html">
9<link rel="import" href="/core/tracks/x_marker_annotation_view.html">
10
11<script>
12'use strict';
13
14tv.exportTo('tv.c.trace_model', function() {
15
16 function XMarkerAnnotation(timestamp) {
17 tv.c.trace_model.Annotation.apply(this, arguments);
18
Chris Craik44c28202015-05-12 17:25:16 -070019 this.timestamp = timestamp;
Chris Craikf516a622015-04-01 17:52:39 -070020 this.strokeStyle = 'rgba(0, 0, 255, 0.5)';
21 }
22
23 XMarkerAnnotation.fromDict = function(dict) {
24 return new XMarkerAnnotation(dict.args.timestamp);
25 }
26
27 XMarkerAnnotation.prototype = {
28 __proto__: tv.c.trace_model.Annotation.prototype,
29
Chris Craikf516a622015-04-01 17:52:39 -070030 toDict: function() {
31 return {
32 typeName: 'xmarker',
33 args: {
34 timestamp: this.timestamp
35 }
36 };
37 },
38
39 createView_: function(viewport) {
40 return new tv.c.annotations.XMarkerAnnotationView(viewport, this);
41 }
42 };
43
44 tv.c.trace_model.Annotation.register(
45 XMarkerAnnotation, {typeName: 'xmarker'});
46
47 return {
48 XMarkerAnnotation: XMarkerAnnotation
49 };
50});
51</script>