OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview 'settings-about-page' contains version and OS related | 6 * @fileoverview 'settings-about-page' contains version and OS related |
7 * information. | 7 * information. |
8 */ | 8 */ |
9 | 9 |
10 Polymer({ | 10 Polymer({ |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 // </if> | 164 // </if> |
165 this.aboutBrowserProxy_.refreshUpdateStatus(); | 165 this.aboutBrowserProxy_.refreshUpdateStatus(); |
166 }, | 166 }, |
167 | 167 |
168 /** | 168 /** |
169 * @param {!UpdateStatusChangedEvent} event | 169 * @param {!UpdateStatusChangedEvent} event |
170 * @private | 170 * @private |
171 */ | 171 */ |
172 onUpdateStatusChanged_: function(event) { | 172 onUpdateStatusChanged_: function(event) { |
173 // <if expr="chromeos"> | 173 // <if expr="chromeos"> |
174 if (event.status == UpdateStatus.CHECKING) | 174 if (event.status == UpdateStatus.CHECKING) { |
175 this.hasCheckedForUpdates_ = true; | 175 this.hasCheckedForUpdates_ = true; |
176 else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { | 176 } else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { |
177 this.showUpdateWarningDialog_ = true; | 177 this.showUpdateWarningDialog_ = true; |
178 this.updateInfo_ = {version: event.version, size: event.size}; | 178 this.updateInfo_ = {version: event.version, size: event.size}; |
179 // Shows 'check for updates' button in case that the user cancels the | |
180 // dialog and then intends to check for update again. | |
181 this.hasCheckedForUpdates_ = false; | |
xiyuan
2017/05/22 18:14:08
Should this be moved to onUpdateWarningDialogClose
weidongg
2017/05/22 19:02:54
There will be a tiny issue if I put it there: alth
xiyuan
2017/05/22 19:28:03
Why would the page gets an UPDATED status while th
weidongg
2017/05/22 19:38:03
The state transition for update engine is IDLE->CH
xiyuan
2017/05/22 20:10:28
Can we use fix this? Either not sending UPDATED on
weidongg
2017/05/22 21:13:26
Sure, I uploaded a new patch set to prevent update
| |
179 } | 182 } |
180 // </if> | 183 // </if> |
181 this.currentUpdateStatusEvent_ = event; | 184 this.currentUpdateStatusEvent_ = event; |
182 }, | 185 }, |
183 | 186 |
184 // <if expr="_google_chrome and is_macosx"> | 187 // <if expr="_google_chrome and is_macosx"> |
185 /** | 188 /** |
186 * @param {!PromoteUpdaterStatus} status | 189 * @param {!PromoteUpdaterStatus} status |
187 * @private | 190 * @private |
188 */ | 191 */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 // </if> | 267 // </if> |
265 }, | 268 }, |
266 | 269 |
267 /** | 270 /** |
268 * @return {string} | 271 * @return {string} |
269 * @private | 272 * @private |
270 */ | 273 */ |
271 getUpdateStatusMessage_: function() { | 274 getUpdateStatusMessage_: function() { |
272 switch (this.currentUpdateStatusEvent_.status) { | 275 switch (this.currentUpdateStatusEvent_.status) { |
273 case UpdateStatus.CHECKING: | 276 case UpdateStatus.CHECKING: |
277 case UpdateStatus.NEED_PERMISSION_TO_UPDATE: | |
274 return this.i18n('aboutUpgradeCheckStarted'); | 278 return this.i18n('aboutUpgradeCheckStarted'); |
275 case UpdateStatus.NEED_PERMISSION_TO_UPDATE: | |
276 // This status is immediately followed by an reporting error status. | |
277 // When update engine reports error, UI just shows that your device is | |
278 // up to date. This is a bug that needs to be fixed in the future. | |
279 // TODO(weidongg/581071): Show proper message when update engine aborts | |
280 // due to cellular connection. | |
281 return ''; | |
282 case UpdateStatus.NEARLY_UPDATED: | 279 case UpdateStatus.NEARLY_UPDATED: |
283 // <if expr="chromeos"> | 280 // <if expr="chromeos"> |
284 if (this.currentChannel_ != this.targetChannel_) | 281 if (this.currentChannel_ != this.targetChannel_) |
285 return this.i18n('aboutUpgradeSuccessChannelSwitch'); | 282 return this.i18n('aboutUpgradeSuccessChannelSwitch'); |
286 // </if> | 283 // </if> |
287 return this.i18n('aboutUpgradeRelaunch'); | 284 return this.i18n('aboutUpgradeRelaunch'); |
288 case UpdateStatus.UPDATED: | 285 case UpdateStatus.UPDATED: |
289 return this.i18n('aboutUpgradeUpToDate'); | 286 return this.i18n('aboutUpgradeUpToDate'); |
290 case UpdateStatus.UPDATING: | 287 case UpdateStatus.UPDATING: |
291 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); | 288 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 /** | 410 /** |
414 * @return {boolean} | 411 * @return {boolean} |
415 * @private | 412 * @private |
416 */ | 413 */ |
417 computeShowCheckUpdates_: function() { | 414 computeShowCheckUpdates_: function() { |
418 // Enable the update button if we are in a stale 'updated' status or | 415 // Enable the update button if we are in a stale 'updated' status or |
419 // update has failed. Disable it otherwise. | 416 // update has failed. Disable it otherwise. |
420 var staleUpdatedStatus = !this.hasCheckedForUpdates_ && | 417 var staleUpdatedStatus = !this.hasCheckedForUpdates_ && |
421 this.checkStatus_(UpdateStatus.UPDATED); | 418 this.checkStatus_(UpdateStatus.UPDATED); |
422 | 419 |
423 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED) || | 420 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); |
424 this.checkStatus_(UpdateStatus.NEED_PERMISSION_TO_UPDATE); | |
425 }, | 421 }, |
426 | 422 |
427 /** | 423 /** |
428 * @return {boolean} | 424 * @return {boolean} |
429 * @private | 425 * @private |
430 */ | 426 */ |
431 shouldShowRegulatoryInfo_: function() { | 427 shouldShowRegulatoryInfo_: function() { |
432 return this.regulatoryInfo_ !== null; | 428 return this.regulatoryInfo_ !== null; |
433 }, | 429 }, |
434 | 430 |
(...skipping 13 matching lines...) Expand all Loading... | |
448 }); | 444 }); |
449 }, | 445 }, |
450 | 446 |
451 // <if expr="_google_chrome"> | 447 // <if expr="_google_chrome"> |
452 /** @private */ | 448 /** @private */ |
453 onReportIssueTap_: function() { | 449 onReportIssueTap_: function() { |
454 this.aboutBrowserProxy_.openFeedbackDialog(); | 450 this.aboutBrowserProxy_.openFeedbackDialog(); |
455 }, | 451 }, |
456 // </if> | 452 // </if> |
457 }); | 453 }); |
OLD | NEW |