3 Copyright (c) 2013 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.
8 <link rel="import" href="/base/ui.html">
13 tv.exportTo('tracing.analysis', function() {
15 * Slice views allow customized visualization of specific slices, indexed by
16 * title. If not registered, the default slice viewing logic is used.
20 var SliceView = tv.ui.define('slice-view');
22 SliceView.prototype = {
23 __proto__: HTMLDivElement.prototype,
25 decorate: function() {
26 this.objectInstance_ = undefined;
29 get requiresTallView() {
47 this.updateContents();
50 updateContents: function() {
51 throw new Error('Not implemented');
55 SliceView.titleToViewInfoMap = {};
56 SliceView.register = function(title, viewConstructor) {
57 if (SliceView.titleToViewInfoMap[title])
58 throw new Error('Handler already registered for ' + title);
59 SliceView.titleToViewInfoMap[title] = {
60 constructor: viewConstructor
64 SliceView.unregister = function(title) {
65 if (SliceView.titleToViewInfoMap[title] === undefined)
66 throw new Error(title + ' not registered');
67 delete SliceView.titleToViewInfoMap[title];
70 SliceView.getViewInfo = function(title) {
71 return SliceView.titleToViewInfoMap[title];