Chromium Code Reviews| Index: tracing/tracing/ui/timeline_view.html |
| diff --git a/tracing/tracing/ui/timeline_view.html b/tracing/tracing/ui/timeline_view.html |
| index 88a9419e73161ab00f4ae7e7dc76b5bbfcb50388..96eeaa2011e271615061b83e75c49e16f676a655 100644 |
| --- a/tracing/tracing/ui/timeline_view.html |
| +++ b/tracing/tracing/ui/timeline_view.html |
| @@ -144,8 +144,12 @@ Polymer({ |
| this.async(function() { |
| this.trackViewContainer_ = Polymer.dom(this).querySelector( |
| '#track_view_container'); |
| - if (!this.trackViewContainer_) |
| + if (!this.trackViewContainer_) { |
| console.error('missing trackviewContainer'); |
| + } |
| + if (this.model_) { |
| + this.updateContents_(); |
| + } |
| }); |
| }, |
| @@ -364,14 +368,22 @@ Polymer({ |
| }, |
| get model() { |
| - if (this.trackView_) |
| - return this.trackView_.model; |
| - return undefined; |
| + return this.model_; |
| }, |
| set model(model) { |
| - var modelInstanceChanged = model !== this.model; |
| - var modelValid = model && !model.bounds.isEmpty; |
| + this.model_ = model; |
| + if (this.isAttached) this.updateContents_(); |
| + }, |
| + |
| + trackViewModel_: function() { |
| + if (this.trackView_) return this.trackView_.model; |
| + return undefined; |
| + }, |
| + |
| + updateContents_: function() { |
| + var modelInstanceChanged = this.model !== this.trackViewModel_(); |
|
benjhayden
2017/02/22 19:59:31
I think it might be confusing to have both |get mo
|
| + var modelValid = this.model && !this.model.bounds.isEmpty; |
| var importWarningsEl = Polymer.dom(this.root).querySelector( |
| '#import-warnings'); |
| @@ -406,17 +418,18 @@ Polymer({ |
| // Set the model. |
| if (modelValid) { |
| - this.trackView_.model = model; |
| + this.trackView_.model = this.model; |
| this.trackView_.viewport.showFlowEvents = this.showFlowEvents; |
| this.trackView_.viewport.highlightVSync = this.highlightVSync; |
| - if (this.railScoreSpan_) |
| - this.railScoreSpan_.model = model; |
| - |
| - this.$.display_unit.preferredTimeDisplayMode = model.intrinsicTimeUnit; |
| + if (this.railScoreSpan_) { |
| + this.railScoreSpan_.model = this.model; |
| + } |
| + this.$.display_unit.preferredTimeDisplayMode = |
| + this.model.intrinsicTimeUnit; |
| } |
| - if (model) { |
| - model.importWarningsThatShouldBeShownToUser.forEach( |
| + if (this.model) { |
| + this.model.importWarningsThatShouldBeShownToUser.forEach( |
| function(importWarning) { |
| importWarningsEl.addMessage( |
| 'Import Warning: ' + importWarning.type + ': ' + |