| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/analysis/analysis_results.html"> | 8 <link rel="import" href="/tracing/analysis/analysis_results.html"> |
| 9 <link rel="import" href="/tracing/analysis/analyze_counters.html"> | 9 <link rel="import" href="/tracing/analysis/analyze_counters.html"> |
| 10 <link rel="import" href="/tracing/analysis/analyze_objects.html"> | 10 <link rel="import" href="/tracing/analysis/analyze_objects.html"> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } else { | 102 } else { |
| 103 subViewsParent = this; | 103 subViewsParent = this; |
| 104 } | 104 } |
| 105 | 105 |
| 106 for (var eventType in eventsByType) { | 106 for (var eventType in eventsByType) { |
| 107 var currentEvents = eventsByType[eventType]; | 107 var currentEvents = eventsByType[eventType]; |
| 108 var subView = undefined; | 108 var subView = undefined; |
| 109 | 109 |
| 110 subView = this.findSubViewForEventsOfSingleType_( | 110 subView = this.findSubViewForEventsOfSingleType_( |
| 111 eventsByType[eventType]); | 111 eventsByType[eventType]); |
| 112 |
| 113 this.tallMode = this.tallMode || subView.requiresTallView; |
| 112 subViewsParent.appendChild(subView); | 114 subViewsParent.appendChild(subView); |
| 115 // Some custom views require to be visible before being handed |
| 116 // a selection to display. Mark it temporarily as selected, so that |
| 117 // the view can make any display calculations necessary. |
| 118 subViewsParent.selectedTab = subView; |
| 119 |
| 113 // There are some subViews that get configured by 'modelEvent' | 120 // There are some subViews that get configured by 'modelEvent' |
| 114 // instead of selection. We need to move them off of this craziness. | 121 // instead of selection. We need to move them off of this craziness. |
| 115 // But, cc.LayerTreeHostView has a concept called selection as | 122 // But, cc.LayerTreeHostView has a concept called selection as |
| 116 // well, but its selection is a cc.Selection. So the properties | 123 // well, but its selection is a cc.Selection. So the properties |
| 117 // collide, in a scary way. | 124 // collide, in a scary way. |
| 118 if (subView.__lookupSetter__('modelEvent')) { | 125 if (subView.__lookupSetter__('modelEvent')) { |
| 119 if (eventsByType[eventType].length != 1) | 126 if (eventsByType[eventType].length != 1) |
| 120 throw new Error('modelEvent-configuration only supported with ' + | 127 throw new Error('modelEvent-configuration only supported with ' + |
| 121 ' selections of length=1'); | 128 ' selections of length=1'); |
| 122 subView.modelEvent = eventsByType[eventType][0]; | 129 subView.modelEvent = eventsByType[eventType][0]; |
| 130 // This forces an update of the view when it becomes visible, |
| 131 // if the view supports this. |
| 132 if (subView.updateContents) { |
| 133 var observer = new MutationObserver(function() { |
| 134 subView.updateContents(); |
| 135 }); |
| 136 observer.observe(subView, { attributeFilter: ['selected'] }); |
| 137 } |
| 123 } else { | 138 } else { |
| 124 subView.selection = eventsByType[eventType]; | 139 subView.selection = eventsByType[eventType]; |
| 125 } | 140 } |
| 126 | 141 |
| 127 this.tallMode = this.tallMode || subView.requiresTallView; | |
| 128 if (usingTabs) { | 142 if (usingTabs) { |
| 129 var tabLabel = convertEventTypeToTabName(eventType); | 143 var tabLabel = convertEventTypeToTabName(eventType); |
| 130 subView.tabLabel = tabLabel; | 144 subView.tabLabel = tabLabel; |
| 131 // Some subViews are not actually built off analysis-sub-view, | 145 // Some subViews are not actually built off analysis-sub-view, |
| 132 // thus they don't all implement the tabLabel property. | 146 // thus they don't all implement the tabLabel property. |
| 133 // This is here in place as a workaround until they are converted | 147 // This is here in place as a workaround until they are converted |
| 134 // to sub-views. | 148 // to sub-views. |
| 135 if (!subView.hasAttribute('tab-label')) | 149 if (!subView.hasAttribute('tab-label')) |
| 136 subView.setAttribute('tab-label', tabLabel); | 150 subView.setAttribute('tab-label', tabLabel); |
| 137 } | 151 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 162 | 176 |
| 163 if (subViewType.options.passSelectionToConstructor) | 177 if (subViewType.options.passSelectionToConstructor) |
| 164 return new subViewType.viewConstructor(selection); | 178 return new subViewType.viewConstructor(selection); |
| 165 else | 179 else |
| 166 return new subViewType.viewConstructor(); | 180 return new subViewType.viewConstructor(); |
| 167 } | 181 } |
| 168 }); | 182 }); |
| 169 })(); | 183 })(); |
| 170 </script> | 184 </script> |
| 171 </polymer-element> | 185 </polymer-element> |
| OLD | NEW |