Chromium Code Reviews| Index: chrome/browser/resources/settings/about_page/about_page.js |
| diff --git a/chrome/browser/resources/settings/about_page/about_page.js b/chrome/browser/resources/settings/about_page/about_page.js |
| index 2f3e20643447a763da7ac49434982876ef5826f1..945765afa36467d7a5d3bbdbe70290f886d0220a 100644 |
| --- a/chrome/browser/resources/settings/about_page/about_page.js |
| +++ b/chrome/browser/resources/settings/about_page/about_page.js |
| @@ -54,6 +54,10 @@ Polymer({ |
| this.browserProxy_.pageReady(); |
| <if expr="chromeos"> |
| + this.addEventListener('target-channel-changed', function(e) { |
| + this.targetChannel_ = e.detail; |
| + }.bind(this)); |
|
dschuyler
2016/05/27 22:16:21
Just a suggestion: I've sometimes had trouble
with
dpapad
2016/05/27 23:32:17
Moved it to attached.
|
| + |
| Promise.all([ |
| this.browserProxy_.getCurrentChannel(), |
| this.browserProxy_.getTargetChannel(), |
| @@ -123,12 +127,11 @@ Polymer({ |
| shouldShowRelaunch_: function() { |
| var shouldShow = false; |
| <if expr="not chromeos"> |
| - shouldShow = |
| - this.currentUpdateStatusEvent_.status == UpdateStatus.NEARLY_UPDATED; |
| + shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED); |
| </if> |
| <if expr="chromeos"> |
| - shouldShow = !this.isTargetChannelMoreStable_() && |
| - this.currentUpdateStatusEvent_.status == UpdateStatus.NEARLY_UPDATED; |
| + shouldShow = this.checkStatus_(UpdateStatus.NEARLY_UPDATED) && |
| + !this.isTargetChannelMoreStable_(); |
| </if> |
| return shouldShow; |
| }, |
| @@ -194,6 +197,15 @@ Polymer({ |
| } |
| }, |
| + /** |
| + * @param {!UpdateStatus} status |
| + * @return {boolean} |
| + * @private |
| + */ |
| + checkStatus_: function(status) { |
| + return this.currentUpdateStatusEvent_.status == status; |
| + }, |
| + |
| <if expr="chromeos"> |
| /** |
| * @return {boolean} |
| @@ -223,8 +235,8 @@ Polymer({ |
| * @private |
| */ |
| shouldShowRelaunchAndPowerwash_: function() { |
| - return this.isTargetChannelMoreStable_() && |
| - this.currentUpdateStatusEvent_.status == UpdateStatus.NEARLY_UPDATED; |
| + return this.checkStatus_(UpdateStatus.NEARLY_UPDATED) && |
| + this.isTargetChannelMoreStable_(); |
| }, |
| /** @private */ |
| @@ -239,7 +251,7 @@ Polymer({ |
| */ |
| shouldShowCheckUpdates_: function() { |
| return !this.hasCheckedForUpdates_ || |
| - this.currentUpdateStatusEvent_.status == UpdateStatus.FAILED; |
| + this.checkStatus_(UpdateStatus.FAILED); |
| }, |
| /** |