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() {
14 var ObjectSnapshotView = tv.ui.define('object-snapshot-view');
16 ObjectSnapshotView.prototype = {
17 __proto__: HTMLDivElement.prototype,
19 decorate: function() {
20 this.objectSnapshot_ = undefined;
23 get requiresTallView() {
28 this.objectSnapshot = obj;
32 return this.objectSnapshot;
35 get objectSnapshot() {
36 return this.objectSnapshot_;
39 set objectSnapshot(i) {
40 this.objectSnapshot_ = i;
41 this.updateContents();
44 updateContents: function() {
45 throw new Error('Not implemented');
49 ObjectSnapshotView.typeNameToViewInfoMap = {};
50 ObjectSnapshotView.register = function(typeName,
53 if (ObjectSnapshotView.typeNameToViewInfoMap[typeName])
54 throw new Error('Handler already registered for ' + typeName);
55 var options = opt_options || {
56 showInTrackView: true,
59 ObjectSnapshotView.typeNameToViewInfoMap[typeName] = {
60 constructor: viewConstructor,
65 ObjectSnapshotView.unregister = function(typeName) {
66 if (ObjectSnapshotView.typeNameToViewInfoMap[typeName] === undefined)
67 throw new Error(typeName + ' not registered');
68 delete ObjectSnapshotView.typeNameToViewInfoMap[typeName];
71 ObjectSnapshotView.getViewInfo = function(typeName) {
72 return ObjectSnapshotView.typeNameToViewInfoMap[typeName];
76 ObjectSnapshotView: ObjectSnapshotView