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 TimelineView visualizes TRACE_EVENT events using the | 7 * @fileoverview TimelineView 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // remove old timeline | 69 // remove old timeline |
70 this.timelineContainer_.textContent = ''; | 70 this.timelineContainer_.textContent = ''; |
71 | 71 |
72 // create new timeline if needed | 72 // create new timeline if needed |
73 if (traceEvents.length) { | 73 if (traceEvents.length) { |
74 if (this.timeline_) | 74 if (this.timeline_) |
75 this.timeline_.detach(); | 75 this.timeline_.detach(); |
76 this.timeline_ = new tracing.Timeline(); | 76 this.timeline_ = new tracing.Timeline(); |
77 this.timeline_.model = this.timelineModel_; | 77 this.timeline_.model = this.timelineModel_; |
| 78 this.timeline_.focusElement = this.parentElement; |
78 this.timelineContainer_.appendChild(this.timeline_); | 79 this.timelineContainer_.appendChild(this.timeline_); |
79 this.timeline_.addEventListener('selectionChange', | 80 this.timeline_.addEventListener('selectionChange', |
80 this.onSelectionChangedBoundToThis_); | 81 this.onSelectionChangedBoundToThis_); |
81 this.onSelectionChanged_(); | 82 this.onSelectionChanged_(); |
82 } else { | 83 } else { |
83 this.timeline_ = null; | 84 this.timeline_ = null; |
84 } | 85 } |
85 }, | 86 }, |
86 | 87 |
87 onSelectionChanged_: function(e) { | 88 onSelectionChanged_: function(e) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 var oldScrollTop = this.timelineContainer_.scrollTop; | 176 var oldScrollTop = this.timelineContainer_.scrollTop; |
176 this.summaryEl_.textContent = text; | 177 this.summaryEl_.textContent = text; |
177 this.timelineContainer_.scrollTop = oldScrollTop; | 178 this.timelineContainer_.scrollTop = oldScrollTop; |
178 } | 179 } |
179 }; | 180 }; |
180 | 181 |
181 return { | 182 return { |
182 TimelineView: TimelineView | 183 TimelineView: TimelineView |
183 }; | 184 }; |
184 }); | 185 }); |
OLD | NEW |