Chris Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 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="/core/trace_model/annotation.html"> |
| 9 | <link rel="import" href="/core/tracks/x_marker_annotation_view.html"> |
| 10 | |
| 11 | <script> |
| 12 | 'use strict'; |
| 13 | |
| 14 | tv.exportTo('tv.c.trace_model', function() { |
| 15 | |
| 16 | function XMarkerAnnotation(timestamp) { |
| 17 | tv.c.trace_model.Annotation.apply(this, arguments); |
| 18 | |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 19 | this.timestamp = timestamp; |
Chris Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 20 | 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 Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 30 | 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> |