Chromium Code Reviews| 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 | |
|
xiyuan
2017/05/11 20:37:25
nit: restore this empty line and insert one after
| |
| 5 /** | 4 /** |
| 6 * @fileoverview 'settings-about-page' contains version and OS related | 5 * @fileoverview 'settings-about-page' contains version and OS related |
| 7 * information. | 6 * information. |
| 8 */ | 7 */ |
| 9 Polymer({ | 8 Polymer({ |
| 10 is: 'settings-about-page', | 9 is: 'settings-about-page', |
| 11 | 10 |
| 12 behaviors: [WebUIListenerBehavior, MainPageBehavior, I18nBehavior], | 11 behaviors: [WebUIListenerBehavior, MainPageBehavior, I18nBehavior], |
| 13 | 12 |
| 14 properties: { | 13 properties: { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 /** @private {!Map<string, string>} */ | 76 /** @private {!Map<string, string>} */ |
| 78 focusConfig_: { | 77 focusConfig_: { |
| 79 type: Object, | 78 type: Object, |
| 80 value: function() { | 79 value: function() { |
| 81 var map = new Map(); | 80 var map = new Map(); |
| 82 map.set( | 81 map.set( |
| 83 settings.Route.DETAILED_BUILD_INFO.path, | 82 settings.Route.DETAILED_BUILD_INFO.path, |
| 84 '#detailed-build-info-trigger'); | 83 '#detailed-build-info-trigger'); |
| 85 return map; | 84 return map; |
| 86 }, | 85 }, |
| 87 } | 86 }, |
| 87 | |
| 88 /** @private */ | |
| 89 showUpdateWarningDialog_: { | |
| 90 type: Boolean, | |
| 91 value: false, | |
| 92 }, | |
| 93 | |
| 94 /** @private {!AboutPageUpdateInfo|undefined} */ | |
| 95 updateInfo_: Object, | |
| 88 // </if> | 96 // </if> |
| 89 }, | 97 }, |
| 90 | 98 |
| 91 observers: [ | 99 observers: [ |
| 92 // <if expr="not chromeos"> | 100 // <if expr="not chromeos"> |
| 93 'updateShowUpdateStatus_(' + | 101 'updateShowUpdateStatus_(' + |
| 94 'obsoleteSystemInfo_, currentUpdateStatusEvent_)', | 102 'obsoleteSystemInfo_, currentUpdateStatusEvent_)', |
| 95 'updateShowRelaunch_(currentUpdateStatusEvent_)', | 103 'updateShowRelaunch_(currentUpdateStatusEvent_)', |
| 96 'updateShowButtonContainer_(showRelaunch_)', | 104 'updateShowButtonContainer_(showRelaunch_)', |
| 97 // </if> | 105 // </if> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 }, | 164 }, |
| 157 | 165 |
| 158 /** | 166 /** |
| 159 * @param {!UpdateStatusChangedEvent} event | 167 * @param {!UpdateStatusChangedEvent} event |
| 160 * @private | 168 * @private |
| 161 */ | 169 */ |
| 162 onUpdateStatusChanged_: function(event) { | 170 onUpdateStatusChanged_: function(event) { |
| 163 // <if expr="chromeos"> | 171 // <if expr="chromeos"> |
| 164 if (event.status == UpdateStatus.CHECKING) | 172 if (event.status == UpdateStatus.CHECKING) |
| 165 this.hasCheckedForUpdates_ = true; | 173 this.hasCheckedForUpdates_ = true; |
| 174 else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { | |
| 175 this.showUpdateWarningDialog_ = true; | |
| 176 this.updateInfo_ = {version: event.version, size: event.size}; | |
| 177 } | |
| 166 // </if> | 178 // </if> |
| 167 this.currentUpdateStatusEvent_ = event; | 179 this.currentUpdateStatusEvent_ = event; |
| 168 }, | 180 }, |
| 169 | 181 |
| 170 // <if expr="_google_chrome and is_macosx"> | 182 // <if expr="_google_chrome and is_macosx"> |
| 171 /** | 183 /** |
| 172 * @param {!PromoteUpdaterStatus} status | 184 * @param {!PromoteUpdaterStatus} status |
| 173 * @private | 185 * @private |
| 174 */ | 186 */ |
| 175 onPromoteUpdaterStatusChanged_: function(status) { | 187 onPromoteUpdaterStatusChanged_: function(status) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 }, | 263 }, |
| 252 | 264 |
| 253 /** | 265 /** |
| 254 * @return {string} | 266 * @return {string} |
| 255 * @private | 267 * @private |
| 256 */ | 268 */ |
| 257 getUpdateStatusMessage_: function() { | 269 getUpdateStatusMessage_: function() { |
| 258 switch (this.currentUpdateStatusEvent_.status) { | 270 switch (this.currentUpdateStatusEvent_.status) { |
| 259 case UpdateStatus.CHECKING: | 271 case UpdateStatus.CHECKING: |
| 260 return this.i18n('aboutUpgradeCheckStarted'); | 272 return this.i18n('aboutUpgradeCheckStarted'); |
| 273 case UpdateStatus.NEED_PERMISSION_TO_UPDATE: | |
| 274 return ""; | |
|
xiyuan
2017/05/11 20:37:25
If this is intended, please document why. Otherwis
stevenjb
2017/05/11 21:03:45
Also use '' not "" (but it seems like we should ha
weidongg
2017/05/11 23:50:44
This transition is IDLE->CHECKING_FOR_UPDATE->NEED
| |
| 261 case UpdateStatus.NEARLY_UPDATED: | 275 case UpdateStatus.NEARLY_UPDATED: |
| 262 // <if expr="chromeos"> | 276 // <if expr="chromeos"> |
| 263 if (this.currentChannel_ != this.targetChannel_) | 277 if (this.currentChannel_ != this.targetChannel_) |
| 264 return this.i18n('aboutUpgradeSuccessChannelSwitch'); | 278 return this.i18n('aboutUpgradeSuccessChannelSwitch'); |
| 265 // </if> | 279 // </if> |
| 266 return this.i18n('aboutUpgradeRelaunch'); | 280 return this.i18n('aboutUpgradeRelaunch'); |
| 267 case UpdateStatus.UPDATED: | 281 case UpdateStatus.UPDATED: |
| 268 return this.i18n('aboutUpgradeUpToDate'); | 282 return this.i18n('aboutUpgradeUpToDate'); |
| 269 case UpdateStatus.UPDATING: | 283 case UpdateStatus.UPDATING: |
| 270 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); | 284 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 /** | 406 /** |
| 393 * @return {boolean} | 407 * @return {boolean} |
| 394 * @private | 408 * @private |
| 395 */ | 409 */ |
| 396 computeShowCheckUpdates_: function() { | 410 computeShowCheckUpdates_: function() { |
| 397 // Enable the update button if we are in a stale 'updated' status or | 411 // Enable the update button if we are in a stale 'updated' status or |
| 398 // update has failed. Disable it otherwise. | 412 // update has failed. Disable it otherwise. |
| 399 var staleUpdatedStatus = !this.hasCheckedForUpdates_ && | 413 var staleUpdatedStatus = !this.hasCheckedForUpdates_ && |
| 400 this.checkStatus_(UpdateStatus.UPDATED); | 414 this.checkStatus_(UpdateStatus.UPDATED); |
| 401 | 415 |
| 402 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); | 416 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED) || |
| 417 this.checkStatus_(UpdateStatus.NEED_PERMISSION_TO_UPDATE); | |
| 403 }, | 418 }, |
| 404 | 419 |
| 405 /** | 420 /** |
| 406 * @return {boolean} | 421 * @return {boolean} |
| 407 * @private | 422 * @private |
| 408 */ | 423 */ |
| 409 shouldShowRegulatoryInfo_: function() { | 424 shouldShowRegulatoryInfo_: function() { |
| 410 return this.regulatoryInfo_ !== null; | 425 return this.regulatoryInfo_ !== null; |
| 411 }, | 426 }, |
| 427 | |
| 428 /** @private */ | |
| 429 onUpdateWarningDialogClose_: function() { | |
| 430 this.showUpdateWarningDialog_ = false; | |
| 431 }, | |
| 412 // </if> | 432 // </if> |
| 413 | 433 |
| 414 /** @private */ | 434 /** @private */ |
| 415 onProductLogoTap_: function() { | 435 onProductLogoTap_: function() { |
| 416 this.$['product-logo'].animate({ | 436 this.$['product-logo'].animate({ |
| 417 transform: ['none', 'rotate(-10turn)'], | 437 transform: ['none', 'rotate(-10turn)'], |
| 418 }, { | 438 }, { |
| 419 duration: 500, | 439 duration: 500, |
| 420 easing: 'cubic-bezier(1, 0, 0, 1)', | 440 easing: 'cubic-bezier(1, 0, 0, 1)', |
| 421 }); | 441 }); |
| 422 }, | 442 }, |
| 423 | 443 |
| 424 // <if expr="_google_chrome"> | 444 // <if expr="_google_chrome"> |
| 425 /** @private */ | 445 /** @private */ |
| 426 onReportIssueTap_: function() { | 446 onReportIssueTap_: function() { |
| 427 this.aboutBrowserProxy_.openFeedbackDialog(); | 447 this.aboutBrowserProxy_.openFeedbackDialog(); |
| 428 }, | 448 }, |
| 429 // </if> | 449 // </if> |
| 430 }); | 450 }); |
| OLD | NEW |