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 36f8b61d2081d3db66c908af6c3495637c691b40..1ad7867a559fa0e5f16daf0d8140e2b05e5e5774 100644 |
| --- a/chrome/browser/resources/settings/about_page/about_page.js |
| +++ b/chrome/browser/resources/settings/about_page/about_page.js |
| @@ -1,7 +1,6 @@ |
| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| - |
| /** |
| * @fileoverview 'settings-about-page' contains version and OS related |
| * information. |
| @@ -84,7 +83,13 @@ Polymer({ |
| '#detailed-build-info-trigger'); |
| return map; |
| }, |
| - } |
| + }, |
| + |
| + /** @private */ |
| + showUpdateWarningDialog_: { |
| + type: Boolean, |
| + value: false, |
| + }, |
| // </if> |
| }, |
| @@ -163,6 +168,21 @@ Polymer({ |
| // <if expr="chromeos"> |
| if (event.status == UpdateStatus.CHECKING) |
| this.hasCheckedForUpdates_ = true; |
| + else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { |
| + this.showUpdateWarningDialog_ = true; |
| + // Async to wait for dialog to appear in the DOM. |
| + this.async(function() { |
| + var dialog = this.$$('settings-update-warning-dialog'); |
| + // event includes the update version and size in bytes. |
| + dialog.setUpdateWarningMessage(event.version, event.size); |
|
stevenjb
2017/05/10 23:29:05
This can be done a bit more cleanly by using data
weidongg
2017/05/11 16:34:05
Done.
|
| + // Register listener to detect when the dialog is closed. Flip the |
| + // boolean once closed to force a restamp next time it is shown such |
| + // that the previous dialog's contents are cleared. |
| + dialog.addEventListener('close', function() { |
| + this.showUpdateWarningDialog_ = false; |
| + }.bind(this)); |
|
stevenjb
2017/05/10 23:29:05
This can be done by adding on-close="onUpdateWarni
weidongg
2017/05/11 16:34:05
Done.
|
| + }.bind(this)); |
| + } |
| // </if> |
| this.currentUpdateStatusEvent_ = event; |
| }, |
| @@ -258,6 +278,8 @@ Polymer({ |
| switch (this.currentUpdateStatusEvent_.status) { |
| case UpdateStatus.CHECKING: |
| return this.i18n('aboutUpgradeCheckStarted'); |
| + case UpdateStatus.NEED_PERMISSION_TO_UPDATE: |
| + return ""; |
| case UpdateStatus.NEARLY_UPDATED: |
| // <if expr="chromeos"> |
| if (this.currentChannel_ != this.targetChannel_) |
| @@ -399,7 +421,8 @@ Polymer({ |
| var staleUpdatedStatus = !this.hasCheckedForUpdates_ && |
| this.checkStatus_(UpdateStatus.UPDATED); |
| - return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); |
| + return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED) || |
| + this.checkStatus_(UpdateStatus.NEED_PERMISSION_TO_UPDATE); |
| }, |
| /** |