| 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 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-about-page', | 10 is: 'settings-about-page', |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 <if expr="chromeos"> | 26 <if expr="chromeos"> |
| 27 /** @private */ | 27 /** @private */ |
| 28 hasCheckedForUpdates_: Boolean, | 28 hasCheckedForUpdates_: Boolean, |
| 29 | 29 |
| 30 /** @private {!BrowserChannel} */ | 30 /** @private {!BrowserChannel} */ |
| 31 currentChannel_: String, | 31 currentChannel_: String, |
| 32 | 32 |
| 33 /** @private {!BrowserChannel} */ | 33 /** @private {!BrowserChannel} */ |
| 34 targetChannel_: String, | 34 targetChannel_: String, |
| 35 |
| 36 /** @private {?RegulatoryInfo} */ |
| 37 regulatoryInfo_: Object, |
| 35 </if> | 38 </if> |
| 36 }, | 39 }, |
| 37 | 40 |
| 38 /** @private {?settings.AboutPageBrowserProxy} */ | 41 /** @private {?settings.AboutPageBrowserProxy} */ |
| 39 browserProxy_: null, | 42 browserProxy_: null, |
| 40 | 43 |
| 41 /** | 44 /** |
| 42 * @type {string} Selector to get the sections. | 45 * @type {string} Selector to get the sections. |
| 43 * TODO(michaelpg): replace duplicate docs with @override once b/24294625 | 46 * TODO(michaelpg): replace duplicate docs with @override once b/24294625 |
| 44 * is fixed. | 47 * is fixed. |
| 45 */ | 48 */ |
| 46 sectionSelector: 'settings-section', | 49 sectionSelector: 'settings-section', |
| 47 | 50 |
| 48 /** @override */ | 51 /** @override */ |
| 49 ready: function() { | 52 ready: function() { |
| 50 this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); | 53 this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); |
| 51 this.browserProxy_.pageReady(); | 54 this.browserProxy_.pageReady(); |
| 52 | 55 |
| 53 <if expr="chromeos"> | 56 <if expr="chromeos"> |
| 54 Promise.all([ | 57 Promise.all([ |
| 55 this.browserProxy_.getCurrentChannel(), | 58 this.browserProxy_.getCurrentChannel(), |
| 56 this.browserProxy_.getTargetChannel(), | 59 this.browserProxy_.getTargetChannel(), |
| 57 ]).then(function(channels) { | 60 ]).then(function(channels) { |
| 58 this.currentChannel_ = channels[0]; | 61 this.currentChannel_ = channels[0]; |
| 59 this.targetChannel_ = channels[1]; | 62 this.targetChannel_ = channels[1]; |
| 60 | 63 |
| 61 this.startListening_(); | 64 this.startListening_(); |
| 62 }.bind(this)); | 65 }.bind(this)); |
| 66 |
| 67 this.browserProxy_.getRegulatoryInfo().then(function(info) { |
| 68 this.regulatoryInfo_ = info; |
| 69 }.bind(this)); |
| 63 </if> | 70 </if> |
| 64 <if expr="not chromeos"> | 71 <if expr="not chromeos"> |
| 65 this.startListening_(); | 72 this.startListening_(); |
| 66 </if> | 73 </if> |
| 67 }, | 74 }, |
| 68 | 75 |
| 69 /** @private */ | 76 /** @private */ |
| 70 startListening_: function() { | 77 startListening_: function() { |
| 71 this.addWebUIListener( | 78 this.addWebUIListener( |
| 72 'update-status-changed', | 79 'update-status-changed', |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 }, | 242 }, |
| 236 | 243 |
| 237 /** | 244 /** |
| 238 * @return {boolean} | 245 * @return {boolean} |
| 239 * @private | 246 * @private |
| 240 */ | 247 */ |
| 241 shouldShowCheckUpdates_: function() { | 248 shouldShowCheckUpdates_: function() { |
| 242 return !this.hasCheckedForUpdates_ || | 249 return !this.hasCheckedForUpdates_ || |
| 243 this.currentUpdateStatusEvent_.status == UpdateStatus.FAILED; | 250 this.currentUpdateStatusEvent_.status == UpdateStatus.FAILED; |
| 244 }, | 251 }, |
| 252 |
| 253 /** |
| 254 * @return {boolean} |
| 255 * @private |
| 256 */ |
| 257 shouldShowRegulatoryInfo_: function() { |
| 258 return this.regulatoryInfo_ !== null; |
| 259 }, |
| 245 </if> | 260 </if> |
| 246 | 261 |
| 247 <if expr="_google_chrome"> | 262 <if expr="_google_chrome"> |
| 248 /** @private */ | 263 /** @private */ |
| 249 onReportIssueTap_: function() { | 264 onReportIssueTap_: function() { |
| 250 this.browserProxy_.openFeedbackDialog(); | 265 this.browserProxy_.openFeedbackDialog(); |
| 251 }, | 266 }, |
| 252 </if> | 267 </if> |
| 253 }); | 268 }); |
| OLD | NEW |