Chromium Code Reviews| Index: chrome/browser/resources/settings/about_page/update_warning_dialog.js |
| diff --git a/chrome/browser/resources/settings/about_page/update_warning_dialog.js b/chrome/browser/resources/settings/about_page/update_warning_dialog.js |
| index 1060fa4f02bce2c5b832d63f3f0ac5150a09a962..562c3b0e490b0d3c4e0a6b8c62b2670b84948caa 100644 |
| --- a/chrome/browser/resources/settings/about_page/update_warning_dialog.js |
| +++ b/chrome/browser/resources/settings/about_page/update_warning_dialog.js |
| @@ -12,6 +12,18 @@ Polymer({ |
| behaviors: [I18nBehavior], |
| + properties: { |
| + /** @public */ |
|
stevenjb
2017/05/11 17:20:16
We don't use @public since that is the default. We
weidongg
2017/05/11 18:09:30
Done.
|
| + updateInfo: { |
| + type: Object, |
| + value: {version: '', size: ''}, |
|
stevenjb
2017/05/11 17:20:16
Shouldn't need to provide a default value here sin
weidongg
2017/05/11 18:09:30
Done.
|
| + observer: '_updateInfoChanged', |
|
stevenjb
2017/05/11 17:20:16
Polymer uses _foo, but in the WebUI code we use fo
weidongg
2017/05/11 18:09:30
Done.
|
| + }, |
| + }, |
| + |
| + /** @private {?settings.AboutPageBrowserProxy} */ |
| + browserProxy_: null, |
| + |
| /** @override */ |
| ready: function() { |
| this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); |
| @@ -24,22 +36,24 @@ Polymer({ |
| /** @private */ |
| onCancelTap_: function() { |
| - // TODO(weidongg): implement the real behaviors here. |
| this.$.dialog.close(); |
| }, |
| /** @private */ |
| onContinueTap_: function() { |
| - // TODO(weidongg): implement the real behaviors here. |
| + this.browserProxy_.requestUpdateOverCellular(this.updateInfo.version, |
| + this.updateInfo.size); |
| this.$.dialog.close(); |
| }, |
| /** |
| - * @param {string} updateSizeMb Size of the update in megabytes. |
| + * @param {string} updateSize Size of the update in bytes. |
| * @private |
| */ |
| - setUpdateWarningMessage: function(updateSizeMb) { |
| - this.$$("#update-warning-message").innerHTML = |
| - this.i18n("aboutUpdateWarningMessage", updateSizeMb); |
| + _updateInfoChanged: function() { |
|
stevenjb
2017/05/11 17:20:16
updateInfoChanged_:
weidongg
2017/05/11 18:09:30
Done.
|
| + this.$$("#update-warning-message").innerHTML = |
| + this.i18n("aboutUpdateWarningMessage", |
| + // Convert bytes to megabytes |
| + Math.floor(Number(this.updateInfo.size) / (1024 * 1024))); |
| }, |
| }); |