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

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: Indentation nits, after merging. 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..cf6d80b91452582f3ec160ff9efb55bb48fd4544 100644
--- a/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chrome/browser/resources/settings/about_page/about_page.js
@@ -49,11 +49,15 @@ Polymer({
sectionSelector: 'settings-section',
/** @override */
- ready: function() {
+ attached: function() {
this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance();
this.browserProxy_.pageReady();
<if expr="chromeos">
+ this.addEventListener('target-channel-changed', function(e) {
+ this.targetChannel_ = e.detail;
+ }.bind(this));
+
Promise.all([
this.browserProxy_.getCurrentChannel(),
this.browserProxy_.getTargetChannel(),
@@ -71,6 +75,8 @@ Polymer({
<if expr="not chromeos">
this.startListening_();
</if>
+
+ this.scroller = this.parentElement;
},
/** @private */
@@ -93,11 +99,6 @@ Polymer({
this.currentUpdateStatusEvent_ = event;
},
- /** @override */
- attached: function() {
- this.scroller = this.parentElement;
- },
-
/** @private */
onHelpTap_: function() {
this.browserProxy_.openHelpPage();
@@ -123,12 +124,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 +194,15 @@ Polymer({
}
},
+ /**
+ * @param {!UpdateStatus} status
+ * @return {boolean}
+ * @private
+ */
+ checkStatus_: function(status) {
+ return this.currentUpdateStatusEvent_.status == status;
+ },
+
<if expr="chromeos">
/**
* @return {boolean}
@@ -223,8 +232,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 +248,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