Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7090)

Unified Diff: chrome/browser/resources/settings/about_page/about_page.js

Issue 2011703002: MD Settings: About page, hooking up channel switcher dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_regulatory_info
Patch Set: Nit. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
},
/**

Powered by Google App Engine
This is Rietveld 408576698