OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 /** | 6 /** |
7 * @fileoverview ProfilingView visualizes TRACE_EVENT events using the | 7 * @fileoverview ProfilingView visualizes TRACE_EVENT events using the |
8 * tracing.Timeline component. | 8 * tracing.Timeline component. |
9 */ | 9 */ |
10 cr.define('tracing', function() { | 10 cr.define('tracing', function() { |
(...skipping 28 matching lines...) Expand all Loading... |
39 this.loadBn_ = document.createElement('button'); | 39 this.loadBn_ = document.createElement('button'); |
40 this.loadBn_.textContent = 'Load'; | 40 this.loadBn_.textContent = 'Load'; |
41 this.loadBn_.addEventListener('click', this.onLoad_.bind(this)); | 41 this.loadBn_.addEventListener('click', this.onLoad_.bind(this)); |
42 | 42 |
43 this.container_ = document.createElement('div'); | 43 this.container_ = document.createElement('div'); |
44 this.container_.className = 'container'; | 44 this.container_.className = 'container'; |
45 | 45 |
46 this.timelineView_ = new TimelineView(); | 46 this.timelineView_ = new TimelineView(); |
47 | 47 |
48 this.controlDiv_.appendChild(this.recordBn_); | 48 this.controlDiv_.appendChild(this.recordBn_); |
49 if (!browserBridge.debugMode) { | 49 this.controlDiv_.appendChild(this.loadBn_); |
50 this.controlDiv_.appendChild(this.loadBn_); | 50 this.controlDiv_.appendChild(this.saveBn_); |
51 this.controlDiv_.appendChild(this.saveBn_); | |
52 } | |
53 | 51 |
54 this.container_.appendChild(this.timelineView_); | 52 this.container_.appendChild(this.timelineView_); |
55 this.appendChild(this.container_); | 53 this.appendChild(this.container_); |
56 | 54 |
57 document.addEventListener('keypress', this.onKeypress_.bind(this)); | 55 document.addEventListener('keypress', this.onKeypress_.bind(this)); |
58 | 56 |
59 tracingController.addEventListener('traceEnded', | 57 tracingController.addEventListener('traceEnded', |
60 this.onRecordDone_.bind(this)); | 58 this.onRecordDone_.bind(this)); |
61 tracingController.addEventListener('loadTraceFileComplete', | 59 tracingController.addEventListener('loadTraceFileComplete', |
62 this.onLoadTraceFileComplete_.bind(this)); | 60 this.onLoadTraceFileComplete_.bind(this)); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 onLoadTraceFileCanceled_: function(e) { | 145 onLoadTraceFileCanceled_: function(e) { |
148 this.overlayEl_.visible = false; | 146 this.overlayEl_.visible = false; |
149 this.overlayEl_ = undefined; | 147 this.overlayEl_ = undefined; |
150 } | 148 } |
151 }; | 149 }; |
152 | 150 |
153 return { | 151 return { |
154 ProfilingView: ProfilingView | 152 ProfilingView: ProfilingView |
155 }; | 153 }; |
156 }); | 154 }); |
OLD | NEW |