1<!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="/tracing/model/annotation.html"> 9<link rel="import" href="/tracing/ui/annotations/x_marker_annotation_view.html"> 10 11<script> 12'use strict'; 13 14tr.exportTo('tr.model', function() { 15 16 function XMarkerAnnotation(timestamp) { 17 tr.model.Annotation.apply(this, arguments); 18 19 this.timestamp = timestamp; 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__: tr.model.Annotation.prototype, 29 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 tr.ui.annotations.XMarkerAnnotationView(viewport, this); 41 } 42 }; 43 44 tr.model.Annotation.register( 45 XMarkerAnnotation, {typeName: 'xmarker'}); 46 47 return { 48 XMarkerAnnotation: XMarkerAnnotation 49 }; 50}); 51</script> 52