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

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

Issue 2583743002: Add mac-only "Set Up Automatic Updates..." button to the new about page. (Closed)
Patch Set: add back nullptr check Created 4 years 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 48690252efb6827f63e5c9cfd90df6c9b01bc73d..2a3e7e06544990cfa73c2817f2dc94cb67290459 100644
--- a/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chrome/browser/resources/settings/about_page/about_page.js
@@ -35,6 +35,11 @@ Polymer({
regulatoryInfo_: Object,
</if>
+<if expr="_google_chrome and is_macosx">
+ /** @private {!PromoteUpdaterStatus} */
+ promoteUpdaterStatus_: Object,
+</if>
+
/** @private {!{obsolete: boolean, endOfLine: boolean}} */
obsoleteSystemInfo_: {
type: Object,
@@ -130,6 +135,11 @@ Polymer({
this.addWebUIListener(
'update-status-changed',
this.onUpdateStatusChanged_.bind(this));
+<if expr="_google_chrome and is_macosx">
+ this.addWebUIListener(
+ 'promotion-state-changed',
+ this.onPromoteUpdaterStatusChanged_.bind(this));
+</if>
this.aboutBrowserProxy_.refreshUpdateStatus();
},
@@ -145,6 +155,38 @@ Polymer({
this.currentUpdateStatusEvent_ = event;
},
+<if expr="_google_chrome and is_macosx">
+ /**
+ * @param {!PromoteUpdaterStatus} status
+ * @private
+ */
+ onPromoteUpdaterStatusChanged_: function(status) {
+ this.promoteUpdaterStatus_ = status;
+ },
+
+ /**
+ * If #promoteUpdater isn't disabled, trigger update promotion.
+ * @private
+ */
+ onPromoteUpdaterTap_: function() {
+ // This is necessary because #promoteUpdater is not a button, so by default
+ // disable doesn't do anything.
+ if (this.promoteUpdaterStatus_.disabled)
+ return;
+ this.aboutBrowserProxy_.promoteUpdater();
+ },
+
+ /**
+ * @param {!Event} event
+ * @private
+ */
+ onLearnMoreTap_: function(event) {
+ // Stop the propagation of events, so that clicking on links inside
+ // actionable items won't trigger action.
+ event.stopPropagation();
+ },
+</if>
+
/** @private */
onHelpTap_: function() {
this.aboutBrowserProxy_.openHelpPage();

Powered by Google App Engine
This is Rietveld 408576698