| <!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/trace_model/annotation.html"> |
| <link rel="import" href="/core/tracks/x_marker_annotation_view.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tv.exportTo('tv.c.trace_model', function() { |
| |
| function XMarkerAnnotation(timestamp) { |
| tv.c.trace_model.Annotation.apply(this, arguments); |
| |
| this.timestamp = timestamp; |
| this.strokeStyle = 'rgba(0, 0, 255, 0.5)'; |
| } |
| |
| XMarkerAnnotation.fromDict = function(dict) { |
| return new XMarkerAnnotation(dict.args.timestamp); |
| } |
| |
| XMarkerAnnotation.prototype = { |
| __proto__: tv.c.trace_model.Annotation.prototype, |
| |
| toDict: function() { |
| return { |
| typeName: 'xmarker', |
| args: { |
| timestamp: this.timestamp |
| } |
| }; |
| }, |
| |
| createView_: function(viewport) { |
| return new tv.c.annotations.XMarkerAnnotationView(viewport, this); |
| } |
| }; |
| |
| tv.c.trace_model.Annotation.register( |
| XMarkerAnnotation, {typeName: 'xmarker'}); |
| |
| return { |
| XMarkerAnnotation: XMarkerAnnotation |
| }; |
| }); |
| </script> |