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({ |
11 is: 'settings-about-page', | 11 is: 'settings-about-page', |
12 | 12 |
13 behaviors: [WebUIListenerBehavior, MainPageBehavior, I18nBehavior], | 13 behaviors: [WebUIListenerBehavior, MainPageBehavior, I18nBehavior], |
14 | 14 |
15 properties: { | 15 properties: { |
16 /** @private {?UpdateStatusChangedEvent} */ | 16 /** @private {?UpdateStatusChangedEvent} */ |
17 currentUpdateStatusEvent_: { | 17 currentUpdateStatusEvent_: { |
18 type: Object, | 18 type: Object, |
19 value: {message: '', progress: 0, status: UpdateStatus.DISABLED}, | 19 value: {message: '', progress: 0, status: UpdateStatus.DISABLED}, |
20 }, | 20 }, |
21 | 21 |
22 // <if expr="chromeos"> | 22 // <if expr="chromeos"> |
23 /** @private */ | 23 /** @private */ |
24 hasCheckedForUpdates_: { | 24 hasCheckedForUpdates_: { |
25 type: Boolean, | 25 type: Boolean, |
26 value: false, | 26 value: false, |
27 }, | 27 }, |
28 | 28 |
29 /** @private {!BrowserChannel} */ | 29 /** @private {!BrowserChannel} */ |
30 currentChannel_: String, | 30 currentChannel_: String, |
31 | 31 |
32 /** @private {!BrowserChannel} */ | 32 /** @private {!BrowserChannel} */ |
33 targetChannel_: String, | 33 targetChannel_: String, |
34 | 34 |
35 /** @private {?RegulatoryInfo} */ | 35 /** @private {?RegulatoryInfo} */ |
36 regulatoryInfo_: Object, | 36 regulatoryInfo_: Object, |
37 // </if> | 37 // </if> |
38 | 38 |
39 // <if expr="_google_chrome and is_macosx"> | 39 // <if expr="_google_chrome and is_macosx"> |
40 /** @private {!PromoteUpdaterStatus} */ | 40 /** @private {!PromoteUpdaterStatus} */ |
41 promoteUpdaterStatus_: Object, | 41 promoteUpdaterStatus_: Object, |
42 // </if> | 42 // </if> |
43 | 43 |
44 /** @private {!{obsolete: boolean, endOfLine: boolean}} */ | 44 /** @private {!{obsolete: boolean, endOfLine: boolean}} */ |
45 obsoleteSystemInfo_: { | 45 obsoleteSystemInfo_: { |
46 type: Object, | 46 type: Object, |
47 value: function() { | 47 value: function() { |
48 return { | 48 return { |
49 obsolete: loadTimeData.getBoolean('aboutObsoleteNowOrSoon'), | 49 obsolete: loadTimeData.getBoolean('aboutObsoleteNowOrSoon'), |
50 endOfLine: loadTimeData.getBoolean('aboutObsoleteEndOfTheLine'), | 50 endOfLine: loadTimeData.getBoolean('aboutObsoleteEndOfTheLine'), |
51 }; | 51 }; |
52 }, | 52 }, |
53 }, | 53 }, |
54 | 54 |
55 /** @private */ | 55 /** @private */ |
56 showUpdateStatus_: Boolean, | 56 showUpdateStatus_: Boolean, |
57 | 57 |
58 /** @private */ | 58 /** @private */ |
59 showButtonContainer_: Boolean, | 59 showButtonContainer_: Boolean, |
60 | 60 |
61 /** @private */ | 61 /** @private */ |
62 showRelaunch_: Boolean, | 62 showRelaunch_: Boolean, |
63 | 63 |
64 // <if expr="chromeos"> | 64 // <if expr="chromeos"> |
65 /** @private */ | 65 /** @private */ |
66 showRelaunchAndPowerwash_: { | 66 showRelaunchAndPowerwash_: { |
67 type: Boolean, | 67 type: Boolean, |
68 computed: 'computeShowRelaunchAndPowerwash_(' + | 68 computed: 'computeShowRelaunchAndPowerwash_(' + |
69 'currentUpdateStatusEvent_, targetChannel_, currentChannel_)', | 69 'currentUpdateStatusEvent_, targetChannel_, currentChannel_)', |
70 }, | 70 }, |
71 | 71 |
72 /** @private */ | 72 /** @private */ |
73 showCheckUpdates_: { | 73 showCheckUpdates_: { |
74 type: Boolean, | 74 type: Boolean, |
(...skipping 14 matching lines...) Expand all Loading... | |
89 }, | 89 }, |
90 | 90 |
91 /** @private */ | 91 /** @private */ |
92 showUpdateWarningDialog_: { | 92 showUpdateWarningDialog_: { |
93 type: Boolean, | 93 type: Boolean, |
94 value: false, | 94 value: false, |
95 }, | 95 }, |
96 | 96 |
97 /** @private {!AboutPageUpdateInfo|undefined} */ | 97 /** @private {!AboutPageUpdateInfo|undefined} */ |
98 updateInfo_: Object, | 98 updateInfo_: Object, |
99 // </if> | 99 // </if> |
100 }, | 100 }, |
101 | 101 |
102 observers: [ | 102 observers: [ |
103 // <if expr="not chromeos"> | 103 // <if expr="not chromeos"> |
104 'updateShowUpdateStatus_(' + | 104 'updateShowUpdateStatus_(' + |
105 'obsoleteSystemInfo_, currentUpdateStatusEvent_)', | 105 'obsoleteSystemInfo_, currentUpdateStatusEvent_)', |
106 'updateShowRelaunch_(currentUpdateStatusEvent_)', | 106 'updateShowRelaunch_(currentUpdateStatusEvent_)', |
107 'updateShowButtonContainer_(showRelaunch_)', | 107 'updateShowButtonContainer_(showRelaunch_)', |
108 // </if> | 108 // </if> |
109 | 109 |
110 // <if expr="chromeos"> | 110 // <if expr="chromeos"> |
111 'updateShowUpdateStatus_(' + | 111 'updateShowUpdateStatus_(' + |
112 'obsoleteSystemInfo_, currentUpdateStatusEvent_,' + | 112 'obsoleteSystemInfo_, currentUpdateStatusEvent_,' + |
113 'hasCheckedForUpdates_)', | 113 'hasCheckedForUpdates_)', |
114 'updateShowRelaunch_(currentUpdateStatusEvent_, targetChannel_,' + | 114 'updateShowRelaunch_(currentUpdateStatusEvent_, targetChannel_,' + |
115 'currentChannel_)', | 115 'currentChannel_)', |
116 'updateShowButtonContainer_(' + | 116 'updateShowButtonContainer_(' + |
117 'showRelaunch_, showRelaunchAndPowerwash_, showCheckUpdates_)', | 117 'showRelaunch_, showRelaunchAndPowerwash_, showCheckUpdates_)', |
118 // </if> | 118 // </if> |
119 ], | 119 ], |
120 | 120 |
121 | 121 |
122 /** @private {?settings.AboutPageBrowserProxy} */ | 122 /** @private {?settings.AboutPageBrowserProxy} */ |
123 aboutBrowserProxy_: null, | 123 aboutBrowserProxy_: null, |
124 | 124 |
125 /** @private {?settings.LifetimeBrowserProxy} */ | 125 /** @private {?settings.LifetimeBrowserProxy} */ |
126 lifetimeBrowserProxy_: null, | 126 lifetimeBrowserProxy_: null, |
127 | 127 |
128 /** @override */ | 128 /** @override */ |
129 attached: function() { | 129 attached: function() { |
130 this.aboutBrowserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); | 130 this.aboutBrowserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); |
131 this.aboutBrowserProxy_.pageReady(); | 131 this.aboutBrowserProxy_.pageReady(); |
132 | 132 |
133 this.lifetimeBrowserProxy_ = | 133 this.lifetimeBrowserProxy_ = |
134 settings.LifetimeBrowserProxyImpl.getInstance(); | 134 settings.LifetimeBrowserProxyImpl.getInstance(); |
135 | 135 |
136 // <if expr="chromeos"> | 136 // <if expr="chromeos"> |
137 this.addEventListener('target-channel-changed', function(e) { | 137 this.addEventListener('target-channel-changed', function(e) { |
138 this.targetChannel_ = e.detail; | 138 this.targetChannel_ = e.detail; |
139 }.bind(this)); | 139 }.bind(this)); |
140 | 140 |
141 this.aboutBrowserProxy_.getChannelInfo().then(function(info) { | 141 this.aboutBrowserProxy_.getChannelInfo().then(function(info) { |
142 this.currentChannel_ = info.currentChannel; | 142 this.currentChannel_ = info.currentChannel; |
143 this.targetChannel_ = info.targetChannel; | 143 this.targetChannel_ = info.targetChannel; |
144 this.startListening_(); | 144 this.startListening_(); |
145 }.bind(this)); | 145 }.bind(this)); |
146 | 146 |
147 this.aboutBrowserProxy_.getRegulatoryInfo().then(function(info) { | 147 this.aboutBrowserProxy_.getRegulatoryInfo().then(function(info) { |
148 this.regulatoryInfo_ = info; | 148 this.regulatoryInfo_ = info; |
149 }.bind(this)); | 149 }.bind(this)); |
150 // </if> | 150 // </if> |
151 // <if expr="not chromeos"> | 151 // <if expr="not chromeos"> |
152 this.startListening_(); | 152 this.startListening_(); |
153 // </if> | 153 // </if> |
154 if (settings.getQueryParameters().get('checkForUpdate') == 'true') { | 154 if (settings.getQueryParameters().get('checkForUpdate') == 'true') { |
155 this.onCheckUpdatesTap_(); | 155 this.onCheckUpdatesTap_(); |
156 } | 156 } |
157 }, | 157 }, |
158 | 158 |
159 /** @private */ | 159 /** @private */ |
160 startListening_: function() { | 160 startListening_: function() { |
161 this.addWebUIListener( | 161 this.addWebUIListener( |
162 'update-status-changed', | 162 'update-status-changed', this.onUpdateStatusChanged_.bind(this)); |
163 this.onUpdateStatusChanged_.bind(this)); | 163 // <if expr="_google_chrome and is_macosx"> |
164 // <if expr="_google_chrome and is_macosx"> | |
165 this.addWebUIListener( | 164 this.addWebUIListener( |
166 'promotion-state-changed', | 165 'promotion-state-changed', |
167 this.onPromoteUpdaterStatusChanged_.bind(this)); | 166 this.onPromoteUpdaterStatusChanged_.bind(this)); |
168 // </if> | 167 // </if> |
169 this.aboutBrowserProxy_.refreshUpdateStatus(); | 168 this.aboutBrowserProxy_.refreshUpdateStatus(); |
170 }, | 169 }, |
171 | 170 |
172 /** | 171 /** |
173 * @param {!UpdateStatusChangedEvent} event | 172 * @param {!UpdateStatusChangedEvent} event |
174 * @private | 173 * @private |
175 */ | 174 */ |
176 onUpdateStatusChanged_: function(event) { | 175 onUpdateStatusChanged_: function(event) { |
177 // <if expr="chromeos"> | 176 // <if expr="chromeos"> |
178 if (event.status == UpdateStatus.CHECKING) { | 177 if (event.status == UpdateStatus.CHECKING) { |
179 this.hasCheckedForUpdates_ = true; | 178 this.hasCheckedForUpdates_ = true; |
180 } else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { | 179 } else if (event.status == UpdateStatus.NEED_PERMISSION_TO_UPDATE) { |
181 this.showUpdateWarningDialog_ = true; | 180 this.showUpdateWarningDialog_ = true; |
182 this.updateInfo_ = {version: event.version, size: event.size}; | 181 this.updateInfo_ = {version: event.version, size: event.size}; |
183 } | 182 } |
184 // </if> | 183 // </if> |
185 this.currentUpdateStatusEvent_ = event; | 184 this.currentUpdateStatusEvent_ = event; |
186 }, | 185 }, |
187 | 186 |
188 // <if expr="_google_chrome and is_macosx"> | 187 // <if expr="_google_chrome and is_macosx"> |
189 /** | 188 /** |
190 * @param {!PromoteUpdaterStatus} status | 189 * @param {!PromoteUpdaterStatus} status |
191 * @private | 190 * @private |
192 */ | 191 */ |
193 onPromoteUpdaterStatusChanged_: function(status) { | 192 onPromoteUpdaterStatusChanged_: function(status) { |
194 this.promoteUpdaterStatus_ = status; | 193 this.promoteUpdaterStatus_ = status; |
195 }, | 194 }, |
196 | 195 |
197 /** | 196 /** |
198 * If #promoteUpdater isn't disabled, trigger update promotion. | 197 * If #promoteUpdater isn't disabled, trigger update promotion. |
199 * @private | 198 * @private |
200 */ | 199 */ |
201 onPromoteUpdaterTap_: function() { | 200 onPromoteUpdaterTap_: function() { |
202 // This is necessary because #promoteUpdater is not a button, so by default | 201 // This is necessary because #promoteUpdater is not a button, so by default |
203 // disable doesn't do anything. | 202 // disable doesn't do anything. |
204 if (this.promoteUpdaterStatus_.disabled) | 203 if (this.promoteUpdaterStatus_.disabled) |
205 return; | 204 return; |
206 this.aboutBrowserProxy_.promoteUpdater(); | 205 this.aboutBrowserProxy_.promoteUpdater(); |
207 }, | 206 }, |
208 | 207 |
209 /** | 208 /** |
210 * @param {!Event} event | 209 * @param {!Event} event |
211 * @private | 210 * @private |
212 */ | 211 */ |
213 onLearnMoreTap_: function(event) { | 212 onLearnMoreTap_: function(event) { |
214 // Stop the propagation of events, so that clicking on links inside | 213 // Stop the propagation of events, so that clicking on links inside |
215 // actionable items won't trigger action. | 214 // actionable items won't trigger action. |
216 event.stopPropagation(); | 215 event.stopPropagation(); |
217 }, | 216 }, |
218 // </if> | 217 // </if> |
219 | 218 |
220 /** @private */ | 219 /** @private */ |
221 onHelpTap_: function() { | 220 onHelpTap_: function() { |
222 this.aboutBrowserProxy_.openHelpPage(); | 221 this.aboutBrowserProxy_.openHelpPage(); |
223 }, | 222 }, |
224 | 223 |
225 /** @private */ | 224 /** @private */ |
226 onRelaunchTap_: function() { | 225 onRelaunchTap_: function() { |
227 this.lifetimeBrowserProxy_.relaunch(); | 226 this.lifetimeBrowserProxy_.relaunch(); |
228 }, | 227 }, |
229 | 228 |
230 /** @private */ | 229 /** @private */ |
231 updateShowUpdateStatus_: function() { | 230 updateShowUpdateStatus_: function() { |
232 // <if expr="chromeos"> | 231 // <if expr="chromeos"> |
233 // Do not show the "updated" status if we haven't checked yet or the update | 232 // Do not show the "updated" status if we haven't checked yet or the update |
234 // warning dialog is shown to user. | 233 // warning dialog is shown to user. |
235 if (this.currentUpdateStatusEvent_.status == UpdateStatus.UPDATED && | 234 if (this.currentUpdateStatusEvent_.status == UpdateStatus.UPDATED && |
236 (!this.hasCheckedForUpdates_ || this.showUpdateWarningDialog_)) { | 235 (!this.hasCheckedForUpdates_ || this.showUpdateWarningDialog_)) { |
237 this.showUpdateStatus_ = false; | 236 this.showUpdateStatus_ = false; |
238 return; | 237 return; |
239 } | 238 } |
240 // </if> | 239 // </if> |
241 this.showUpdateStatus_ = | 240 this.showUpdateStatus_ = |
242 this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED && | 241 this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED && |
243 !this.obsoleteSystemInfo_.endOfLine; | 242 !this.obsoleteSystemInfo_.endOfLine; |
244 }, | 243 }, |
245 | 244 |
246 /** | 245 /** |
247 * Hide the button container if all buttons are hidden, otherwise the | 246 * Hide the button container if all buttons are hidden, otherwise the |
248 * container displays an unwanted border (see separator class). | 247 * container displays an unwanted border (see separator class). |
249 * @private | 248 * @private |
250 */ | 249 */ |
251 updateShowButtonContainer_: function() { | 250 updateShowButtonContainer_: function() { |
252 // <if expr="not chromeos"> | 251 // <if expr="not chromeos"> |
253 this.showButtonContainer_ = this.showRelaunch_; | 252 this.showButtonContainer_ = this.showRelaunch_; |
254 // </if> | 253 // </if> |
255 // <if expr="chromeos"> | 254 // <if expr="chromeos"> |
256 this.showButtonContainer_ = this.showRelaunch_ || | 255 this.showButtonContainer_ = this.showRelaunch_ || |
257 this.showRelaunchAndPowerwash_ || this.showCheckUpdates_; | 256 this.showRelaunchAndPowerwash_ || this.showCheckUpdates_; |
258 // </if> | 257 // </if> |
259 }, | 258 }, |
260 | 259 |
261 /** @private */ | 260 /** @private */ |
262 updateShowRelaunch_: function() { | 261 updateShowRelaunch_: function() { |
263 // <if expr="not chromeos"> | 262 // <if expr="not chromeos"> |
264 this.showRelaunch_ = this.checkStatus_(UpdateStatus.NEARLY_UPDATED); | 263 this.showRelaunch_ = this.checkStatus_(UpdateStatus.NEARLY_UPDATED); |
265 // </if> | 264 // </if> |
266 // <if expr="chromeos"> | 265 // <if expr="chromeos"> |
267 this.showRelaunch_ = this.checkStatus_(UpdateStatus.NEARLY_UPDATED) && | 266 this.showRelaunch_ = this.checkStatus_(UpdateStatus.NEARLY_UPDATED) && |
268 !this.isTargetChannelMoreStable_(); | 267 !this.isTargetChannelMoreStable_(); |
269 // </if> | 268 // </if> |
270 }, | 269 }, |
271 | 270 |
272 /** | 271 /** |
273 * @return {string} | 272 * @return {string} |
274 * @private | 273 * @private |
275 */ | 274 */ |
276 getUpdateStatusMessage_: function() { | 275 getUpdateStatusMessage_: function() { |
277 switch (this.currentUpdateStatusEvent_.status) { | 276 switch (this.currentUpdateStatusEvent_.status) { |
278 case UpdateStatus.CHECKING: | 277 case UpdateStatus.CHECKING: |
279 case UpdateStatus.NEED_PERMISSION_TO_UPDATE: | 278 case UpdateStatus.NEED_PERMISSION_TO_UPDATE: |
280 return this.i18nAdvanced('aboutUpgradeCheckStarted'); | 279 return this.i18nAdvanced('aboutUpgradeCheckStarted'); |
281 case UpdateStatus.NEARLY_UPDATED: | 280 case UpdateStatus.NEARLY_UPDATED: |
282 // <if expr="chromeos"> | 281 // <if expr="chromeos"> |
283 if (this.currentChannel_ != this.targetChannel_) | 282 if (this.currentChannel_ != this.targetChannel_) |
284 return this.i18nAdvanced('aboutUpgradeSuccessChannelSwitch'); | 283 return this.i18nAdvanced('aboutUpgradeSuccessChannelSwitch'); |
285 // </if> | 284 // </if> |
286 return this.i18nAdvanced('aboutUpgradeRelaunch'); | 285 return this.i18nAdvanced('aboutUpgradeRelaunch'); |
287 case UpdateStatus.UPDATED: | 286 case UpdateStatus.UPDATED: |
288 return this.i18nAdvanced('aboutUpgradeUpToDate'); | 287 return this.i18nAdvanced('aboutUpgradeUpToDate'); |
289 case UpdateStatus.UPDATING: | 288 case UpdateStatus.UPDATING: |
290 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); | 289 assert(typeof this.currentUpdateStatusEvent_.progress == 'number'); |
291 var progressPercent = this.currentUpdateStatusEvent_.progress + '%'; | 290 var progressPercent = this.currentUpdateStatusEvent_.progress + '%'; |
292 | 291 |
293 // <if expr="chromeos"> | 292 // <if expr="chromeos"> |
294 if (this.currentChannel_ != this.targetChannel_) { | 293 if (this.currentChannel_ != this.targetChannel_) { |
295 return this.i18nAdvanced('aboutUpgradeUpdatingChannelSwitch', { | 294 return this.i18nAdvanced('aboutUpgradeUpdatingChannelSwitch', { |
296 substitutions: [ | 295 substitutions: [ |
297 this.i18nAdvanced( | 296 this.i18nAdvanced( |
298 settings.browserChannelToI18nId(this.targetChannel_)), | 297 settings.browserChannelToI18nId(this.targetChannel_)), |
299 progressPercent | 298 progressPercent |
300 ] | 299 ] |
301 }); | 300 }); |
302 } | 301 } |
303 // </if> | 302 // </if> |
304 if (this.currentUpdateStatusEvent_.progress > 0) { | 303 if (this.currentUpdateStatusEvent_.progress > 0) { |
305 // NOTE(dbeam): some platforms (i.e. Mac) always send 0% while | 304 // NOTE(dbeam): some platforms (i.e. Mac) always send 0% while |
306 // updating (they don't support incremental upgrade progress). Though | 305 // updating (they don't support incremental upgrade progress). Though |
307 // it's certainly quite possible to validly end up here with 0% on | 306 // it's certainly quite possible to validly end up here with 0% on |
308 // platforms that support incremental progress, nobody really likes | 307 // platforms that support incremental progress, nobody really likes |
309 // seeing that they're 0% done with something. | 308 // seeing that they're 0% done with something. |
310 return this.i18nAdvanced('aboutUpgradeUpdatingPercent', { | 309 return this.i18nAdvanced('aboutUpgradeUpdatingPercent', { |
311 substitutions: [progressPercent], | 310 substitutions: [progressPercent], |
312 }); | 311 }); |
313 } | 312 } |
314 return this.i18nAdvanced('aboutUpgradeUpdating'); | 313 return this.i18nAdvanced('aboutUpgradeUpdating'); |
315 default: | 314 default: |
316 function formatMessage(msg) { | 315 function formatMessage(msg) { |
317 return parseHtmlSubset( | 316 return parseHtmlSubset('<b>' + msg + '</b>', ['br', 'pre']) |
318 '<b>' + msg + '</b>', ['br', 'pre']).firstChild.innerHTML; | 317 .firstChild.innerHTML; |
319 } | 318 } |
320 var result = ''; | 319 var result = ''; |
321 var message = this.currentUpdateStatusEvent_.message; | 320 var message = this.currentUpdateStatusEvent_.message; |
322 if (message) | 321 if (message) |
323 result += formatMessage(message); | 322 result += formatMessage(message); |
324 var connectMessage = this.currentUpdateStatusEvent_.connectionTypes; | 323 var connectMessage = this.currentUpdateStatusEvent_.connectionTypes; |
325 if (connectMessage) | 324 if (connectMessage) |
326 result += '<div>' + formatMessage(connectMessage) + '</div>'; | 325 result += '<div>' + formatMessage(connectMessage) + '</div>'; |
327 return result; | 326 return result; |
328 } | 327 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 | 369 |
371 /** | 370 /** |
372 * @param {!UpdateStatus} status | 371 * @param {!UpdateStatus} status |
373 * @return {boolean} | 372 * @return {boolean} |
374 * @private | 373 * @private |
375 */ | 374 */ |
376 checkStatus_: function(status) { | 375 checkStatus_: function(status) { |
377 return this.currentUpdateStatusEvent_.status == status; | 376 return this.currentUpdateStatusEvent_.status == status; |
378 }, | 377 }, |
379 | 378 |
380 // <if expr="chromeos"> | 379 // <if expr="chromeos"> |
381 /** | 380 /** |
382 * @return {boolean} | 381 * @return {boolean} |
383 * @private | 382 * @private |
384 */ | 383 */ |
385 isTargetChannelMoreStable_: function() { | 384 isTargetChannelMoreStable_: function() { |
386 assert(this.currentChannel_.length > 0); | 385 assert(this.currentChannel_.length > 0); |
387 assert(this.targetChannel_.length > 0); | 386 assert(this.targetChannel_.length > 0); |
388 return settings.isTargetChannelMoreStable( | 387 return settings.isTargetChannelMoreStable( |
389 this.currentChannel_, this.targetChannel_); | 388 this.currentChannel_, this.targetChannel_); |
390 }, | 389 }, |
(...skipping 23 matching lines...) Expand all Loading... | |
414 this.aboutBrowserProxy_.requestUpdate(); | 413 this.aboutBrowserProxy_.requestUpdate(); |
415 }, | 414 }, |
416 | 415 |
417 /** | 416 /** |
418 * @return {boolean} | 417 * @return {boolean} |
419 * @private | 418 * @private |
420 */ | 419 */ |
421 computeShowCheckUpdates_: function() { | 420 computeShowCheckUpdates_: function() { |
422 // Enable the update button if we are in a stale 'updated' status or | 421 // Enable the update button if we are in a stale 'updated' status or |
423 // update has failed. Disable it otherwise. | 422 // update has failed. Disable it otherwise. |
424 var staleUpdatedStatus = !this.hasCheckedForUpdates_ && | 423 var staleUpdatedStatus = |
425 this.checkStatus_(UpdateStatus.UPDATED); | 424 !this.hasCheckedForUpdates_ && this.checkStatus_(UpdateStatus.UPDATED); |
426 | 425 |
427 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); | 426 return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); |
428 }, | 427 }, |
429 | 428 |
430 /** | 429 /** |
431 * @return {boolean} | 430 * @return {boolean} |
432 * @private | 431 * @private |
433 */ | 432 */ |
434 shouldShowRegulatoryInfo_: function() { | 433 shouldShowRegulatoryInfo_: function() { |
435 return this.regulatoryInfo_ !== null; | 434 return this.regulatoryInfo_ !== null; |
436 }, | 435 }, |
437 | 436 |
438 /** @private */ | 437 /** @private */ |
439 onUpdateWarningDialogClose_: function() { | 438 onUpdateWarningDialogClose_: function() { |
440 this.showUpdateWarningDialog_ = false; | 439 this.showUpdateWarningDialog_ = false; |
441 // Shows 'check for updates' button in case that the user cancels the | 440 // Shows 'check for updates' button in case that the user cancels the |
442 // dialog and then intends to check for update again. | 441 // dialog and then intends to check for update again. |
443 this.hasCheckedForUpdates_ = false; | 442 this.hasCheckedForUpdates_ = false; |
444 }, | 443 }, |
445 // </if> | 444 // </if> |
446 | 445 |
447 /** @private */ | 446 /** @private */ |
448 onProductLogoTap_: function() { | 447 onProductLogoTap_: function() { |
449 this.$['product-logo'].animate({ | 448 this.$['product-logo'].animate( |
450 transform: ['none', 'rotate(-10turn)'], | 449 { |
451 }, { | 450 transform: ['none', 'rotate(-10turn)'], |
452 duration: 500, | 451 }, |
453 easing: 'cubic-bezier(1, 0, 0, 1)', | 452 { |
dschuyler
2017/06/16 23:09:06
Is there an option in the formatter to put '}, {'
Dan Beam
2017/06/17 00:11:06
¯\_(ツ)_/¯
| |
454 }); | 453 duration: 500, |
454 easing: 'cubic-bezier(1, 0, 0, 1)', | |
455 }); | |
455 }, | 456 }, |
456 | 457 |
457 // <if expr="_google_chrome"> | 458 // <if expr="_google_chrome"> |
458 /** @private */ | 459 /** @private */ |
459 onReportIssueTap_: function() { | 460 onReportIssueTap_: function() { |
460 this.aboutBrowserProxy_.openFeedbackDialog(); | 461 this.aboutBrowserProxy_.openFeedbackDialog(); |
461 }, | 462 }, |
462 // </if> | 463 // </if> |
463 }); | 464 }); |
OLD | NEW |