Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / analysis / object_snapshot_view.html
1 <!DOCTYPE html>
2 <!--
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.
6 -->
7
8 <link rel="import" href="/base/ui.html">
9
10 <script>
11 'use strict';
12
13 tv.exportTo('tracing.analysis', function() {
14   var ObjectSnapshotView = tv.ui.define('object-snapshot-view');
15
16   ObjectSnapshotView.prototype = {
17     __proto__: HTMLDivElement.prototype,
18
19     decorate: function() {
20       this.objectSnapshot_ = undefined;
21     },
22
23     get requiresTallView() {
24       return true;
25     },
26
27     set modelEvent(obj) {
28       this.objectSnapshot = obj;
29     },
30
31     get modelEvent() {
32       return this.objectSnapshot;
33     },
34
35     get objectSnapshot() {
36       return this.objectSnapshot_;
37     },
38
39     set objectSnapshot(i) {
40       this.objectSnapshot_ = i;
41       this.updateContents();
42     },
43
44     updateContents: function() {
45       throw new Error('Not implemented');
46     }
47   };
48
49   ObjectSnapshotView.typeNameToViewInfoMap = {};
50   ObjectSnapshotView.register = function(typeName,
51                                          viewConstructor,
52                                          opt_options) {
53     if (ObjectSnapshotView.typeNameToViewInfoMap[typeName])
54       throw new Error('Handler already registered for ' + typeName);
55     var options = opt_options || {
56       showInTrackView: true,
57       showInstances: true
58     };
59     ObjectSnapshotView.typeNameToViewInfoMap[typeName] = {
60       constructor: viewConstructor,
61       options: options
62     };
63   };
64
65   ObjectSnapshotView.unregister = function(typeName) {
66     if (ObjectSnapshotView.typeNameToViewInfoMap[typeName] === undefined)
67       throw new Error(typeName + ' not registered');
68     delete ObjectSnapshotView.typeNameToViewInfoMap[typeName];
69   };
70
71   ObjectSnapshotView.getViewInfo = function(typeName) {
72     return ObjectSnapshotView.typeNameToViewInfoMap[typeName];
73   };
74
75   return {
76     ObjectSnapshotView: ObjectSnapshotView
77   };
78 });
79 </script>