1<!DOCTYPE html>
2<!--
3Copyright (c) 2014 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/base/base.html">
9<link rel="import" href="/tracing/base/extension_registry.html">
10
11<script>
12'use strict';
13
14/**
15 * @fileoverview Allows custom highlighting to be added to the full model track.
16 */
17tr.exportTo('tr.ui.tracks', function() {
18
19  /**
20   * Highlights cetrain features of the model.
21   * @constructor
22   */
23  function Highlighter(viewport) {
24    if (viewport === undefined) {
25      throw new Error('viewport must be provided');
26    }
27    this.viewport_ = viewport;
28  };
29
30  Highlighter.prototype = {
31    __proto__: Object.prototype,
32
33    processModel: function(model) {
34      throw new Error('processModel implementation missing');
35    },
36
37    drawHighlight: function(ctx, dt, viewLWorld, viewRWorld, viewHeight) {
38      throw new Error('drawHighlight implementation missing');
39    }
40  };
41
42
43  var options = new tr.b.ExtensionRegistryOptions(tr.b.BASIC_REGISTRY_MODE);
44  options.defaultMetadata = {};
45  options.mandatoryBaseClass = Highlighter;
46  tr.b.decorateExtensionRegistry(Highlighter, options);
47
48  return {
49    Highlighter: Highlighter
50  };
51});
52</script>
53
54