| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/base/settings.html"> | 8 <link rel="import" href="/tracing/base/settings.html"> |
| 9 <link rel="import" href="/tracing/base/utils.html"> | 9 <link rel="import" href="/tracing/base/utils.html"> |
| 10 <link rel="import" href="/tracing/core/scripting_controller.html"> | 10 <link rel="import" href="/tracing/core/scripting_controller.html"> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 this.scriptingCtl_.controller = new tr.c.ScriptingController( | 166 this.scriptingCtl_.controller = new tr.c.ScriptingController( |
| 167 this.brushingStateController_); | 167 this.brushingStateController_); |
| 168 | 168 |
| 169 this.sidePanelContainer_.brushingStateController = | 169 this.sidePanelContainer_.brushingStateController = |
| 170 this.brushingStateController_; | 170 this.brushingStateController_; |
| 171 | 171 |
| 172 if (window.tr.metrics && window.tr.metrics.sh && | 172 if (window.tr.metrics && window.tr.metrics.sh && |
| 173 window.tr.metrics.sh.SystemHealthMetric) { | 173 window.tr.metrics.sh.SystemHealthMetric) { |
| 174 this.railScoreSpan_ = document.createElement( | 174 this.railScoreSpan_ = document.createElement( |
| 175 'tr-metrics-ui-sh-system-health-span'); | 175 'tr-metrics-ui-sh-system-health-span'); |
| 176 this.rightControls.appendChild(this.railScoreSpan_); | 176 Polymer.dom(this.rightControls).appendChild(this.railScoreSpan_); |
| 177 } else { | 177 } else { |
| 178 this.railScoreSpan_ = undefined; | 178 this.railScoreSpan_ = undefined; |
| 179 } | 179 } |
| 180 | 180 |
| 181 this.optionsDropdown_ = this.$.view_options_dropdown; | 181 this.optionsDropdown_ = this.$.view_options_dropdown; |
| 182 this.optionsDropdown_.iconElement.textContent = 'View Options'; | 182 this.optionsDropdown_.iconElement.textContent = 'View Options'; |
| 183 | 183 |
| 184 this.showFlowEvents_ = false; | 184 this.showFlowEvents_ = false; |
| 185 this.optionsDropdown_.appendChild(tr.ui.b.createCheckBox( | 185 Polymer.dom(this.optionsDropdown_).appendChild(tr.ui.b.createCheckBox( |
| 186 this, 'showFlowEvents', | 186 this, 'showFlowEvents', |
| 187 'tr.ui.TimelineView.showFlowEvents', false, | 187 'tr.ui.TimelineView.showFlowEvents', false, |
| 188 'Flow events')); | 188 'Flow events')); |
| 189 this.highlightVSync_ = false; | 189 this.highlightVSync_ = false; |
| 190 this.highlightVSyncCheckbox_ = tr.ui.b.createCheckBox( | 190 this.highlightVSyncCheckbox_ = tr.ui.b.createCheckBox( |
| 191 this, 'highlightVSync', | 191 this, 'highlightVSync', |
| 192 'tr.ui.TimelineView.highlightVSync', false, | 192 'tr.ui.TimelineView.highlightVSync', false, |
| 193 'Highlight VSync'); | 193 'Highlight VSync'); |
| 194 this.optionsDropdown_.appendChild(this.highlightVSyncCheckbox_); | 194 Polymer.dom(this.optionsDropdown_).appendChild( |
| 195 this.highlightVSyncCheckbox_); |
| 195 | 196 |
| 196 this.initMetadataButton_(); | 197 this.initMetadataButton_(); |
| 197 this.initConsoleButton_(); | 198 this.initConsoleButton_(); |
| 198 this.initHelpButton_(); | 199 this.initHelpButton_(); |
| 199 | 200 |
| 200 this.collapsingControls.appendChild(this.scriptingCtl_); | 201 Polymer.dom(this.collapsingControls).appendChild(this.scriptingCtl_); |
| 201 | 202 |
| 202 this.dragEl_ = this.$.drag_handle; | 203 this.dragEl_ = this.$.drag_handle; |
| 203 | 204 |
| 204 this.analysisEl_ = this.$.analysis; | 205 this.analysisEl_ = this.$.analysis; |
| 205 this.analysisEl_.brushingStateController = this.brushingStateController_; | 206 this.analysisEl_.brushingStateController = this.brushingStateController_; |
| 206 | 207 |
| 207 this.addEventListener( | 208 this.addEventListener( |
| 208 'requestSelectionChange', | 209 'requestSelectionChange', |
| 209 function(e) { | 210 function(e) { |
| 210 var sc = this.brushingStateController_; | 211 var sc = this.brushingStateController_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 243 |
| 243 var faviconData = tr.ui.b.FaviconsByHue[hue]; | 244 var faviconData = tr.ui.b.FaviconsByHue[hue]; |
| 244 if (faviconData === undefined) | 245 if (faviconData === undefined) |
| 245 faviconData = tr.ui.b.FaviconsByHue['blue']; | 246 faviconData = tr.ui.b.FaviconsByHue['blue']; |
| 246 | 247 |
| 247 // Find link if its there | 248 // Find link if its there |
| 248 var link = document.head.querySelector('link[rel="shortcut icon"]'); | 249 var link = document.head.querySelector('link[rel="shortcut icon"]'); |
| 249 if (!link) { | 250 if (!link) { |
| 250 link = document.createElement('link'); | 251 link = document.createElement('link'); |
| 251 link.rel = 'shortcut icon'; | 252 link.rel = 'shortcut icon'; |
| 252 document.head.appendChild(link); | 253 Polymer.dom(document.head).appendChild(link); |
| 253 } | 254 } |
| 254 link.href = faviconData; | 255 link.href = faviconData; |
| 255 }, | 256 }, |
| 256 | 257 |
| 257 get showFlowEvents() { | 258 get showFlowEvents() { |
| 258 return this.showFlowEvents_; | 259 return this.showFlowEvents_; |
| 259 }, | 260 }, |
| 260 | 261 |
| 261 set showFlowEvents(showFlowEvents) { | 262 set showFlowEvents(showFlowEvents) { |
| 262 this.showFlowEvents_ = showFlowEvents; | 263 this.showFlowEvents_ = showFlowEvents; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 275 return; | 276 return; |
| 276 this.trackView_.viewport.highlightVSync = highlightVSync; | 277 this.trackView_.viewport.highlightVSync = highlightVSync; |
| 277 }, | 278 }, |
| 278 | 279 |
| 279 initHelpButton_: function() { | 280 initHelpButton_: function() { |
| 280 var helpButtonEl = this.$.view_help_button; | 281 var helpButtonEl = this.$.view_help_button; |
| 281 | 282 |
| 282 function onClick(e) { | 283 function onClick(e) { |
| 283 var dlg = new tr.ui.b.Overlay(); | 284 var dlg = new tr.ui.b.Overlay(); |
| 284 dlg.title = 'Chrome Tracing Help'; | 285 dlg.title = 'Chrome Tracing Help'; |
| 285 dlg.appendChild( | 286 Polymer.dom(dlg).appendChild( |
| 286 document.createElement('tr-ui-timeline-view-help-overlay')); | 287 document.createElement('tr-ui-timeline-view-help-overlay')); |
| 287 dlg.visible = true; | 288 dlg.visible = true; |
| 288 | 289 |
| 289 // Stop event so it doesn't trigger new click listener on document. | 290 // Stop event so it doesn't trigger new click listener on document. |
| 290 e.stopPropagation(); | 291 e.stopPropagation(); |
| 291 } | 292 } |
| 292 helpButtonEl.addEventListener('click', onClick.bind(this)); | 293 helpButtonEl.addEventListener('click', onClick.bind(this)); |
| 293 }, | 294 }, |
| 294 | 295 |
| 295 initConsoleButton_: function() { | 296 initConsoleButton_: function() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 307 var showEl = this.$.view_metadata_button; | 308 var showEl = this.$.view_metadata_button; |
| 308 | 309 |
| 309 function onClick(e) { | 310 function onClick(e) { |
| 310 var dlg = new tr.ui.b.Overlay(); | 311 var dlg = new tr.ui.b.Overlay(); |
| 311 dlg.title = 'Metadata for trace'; | 312 dlg.title = 'Metadata for trace'; |
| 312 | 313 |
| 313 var metadataOverlay = document.createElement( | 314 var metadataOverlay = document.createElement( |
| 314 'tr-ui-timeline-view-metadata-overlay'); | 315 'tr-ui-timeline-view-metadata-overlay'); |
| 315 metadataOverlay.metadata = this.model.metadata; | 316 metadataOverlay.metadata = this.model.metadata; |
| 316 | 317 |
| 317 dlg.appendChild(metadataOverlay); | 318 Polymer.dom(dlg).appendChild(metadataOverlay); |
| 318 dlg.visible = true; | 319 dlg.visible = true; |
| 319 | 320 |
| 320 e.stopPropagation(); | 321 e.stopPropagation(); |
| 321 return false; | 322 return false; |
| 322 } | 323 } |
| 323 showEl.addEventListener('click', onClick.bind(this)); | 324 showEl.addEventListener('click', onClick.bind(this)); |
| 324 | 325 |
| 325 this.updateMetadataButtonVisibility_(); | 326 this.updateMetadataButtonVisibility_(); |
| 326 }, | 327 }, |
| 327 | 328 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 this.brushingStateController_.modelWillChange(); | 387 this.brushingStateController_.modelWillChange(); |
| 387 } | 388 } |
| 388 | 389 |
| 389 // Create new trackView if needed. | 390 // Create new trackView if needed. |
| 390 if (modelValid && !this.trackView_) { | 391 if (modelValid && !this.trackView_) { |
| 391 this.trackView_ = document.createElement('tr-ui-timeline-track-view'); | 392 this.trackView_ = document.createElement('tr-ui-timeline-track-view'); |
| 392 this.trackView_.timelineView = this; | 393 this.trackView_.timelineView = this; |
| 393 | 394 |
| 394 this.trackView.brushingStateController = this.brushingStateController_; | 395 this.trackView.brushingStateController = this.brushingStateController_; |
| 395 | 396 |
| 396 this.trackViewContainer_.appendChild(this.trackView_); | 397 Polymer.dom(this.trackViewContainer_).appendChild(this.trackView_); |
| 397 this.trackView_.viewport.addEventListener( | 398 this.trackView_.viewport.addEventListener( |
| 398 'change', this.onViewportChanged_); | 399 'change', this.onViewportChanged_); |
| 399 } | 400 } |
| 400 | 401 |
| 401 // Set the model. | 402 // Set the model. |
| 402 if (modelValid) { | 403 if (modelValid) { |
| 403 this.trackView_.model = model; | 404 this.trackView_.model = model; |
| 404 this.trackView_.viewport.showFlowEvents = this.showFlowEvents; | 405 this.trackView_.viewport.showFlowEvents = this.showFlowEvents; |
| 405 this.trackView_.viewport.highlightVSync = this.highlightVSync; | 406 this.trackView_.viewport.highlightVSync = this.highlightVSync; |
| 406 if (this.railScoreSpan_) | 407 if (this.railScoreSpan_) |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 toggleHighlightVSync_: function() { | 527 toggleHighlightVSync_: function() { |
| 527 this.highlightVSyncCheckbox_.checked = | 528 this.highlightVSyncCheckbox_.checked = |
| 528 !this.highlightVSyncCheckbox_.checked; | 529 !this.highlightVSyncCheckbox_.checked; |
| 529 }, | 530 }, |
| 530 | 531 |
| 531 setFindCtlText: function(string) { | 532 setFindCtlText: function(string) { |
| 532 this.findCtl_.setText(string); | 533 this.findCtl_.setText(string); |
| 533 } | 534 } |
| 534 }); | 535 }); |
| 535 </script> | 536 </script> |
| OLD | NEW |