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