Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: chrome/browser/resources/settings/about_page/about_page.js

Issue 2714883002: MD Settings: About page, show error messages with <br> and <pre> tags. (Closed)
Patch Set: Resolved conflicts. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // NOTE(dbeam): some platforms (i.e. Mac) always send 0% while 270 // NOTE(dbeam): some platforms (i.e. Mac) always send 0% while
271 // updating (they don't support incremental upgrade progress). Though 271 // updating (they don't support incremental upgrade progress). Though
272 // it's certainly quite possible to validly end up here with 0% on 272 // it's certainly quite possible to validly end up here with 0% on
273 // platforms that support incremental progress, nobody really likes 273 // platforms that support incremental progress, nobody really likes
274 // seeing that they're 0% done with something. 274 // seeing that they're 0% done with something.
275 return this.i18n('aboutUpgradeUpdatingPercent', progressPercent); 275 return this.i18n('aboutUpgradeUpdatingPercent', progressPercent);
276 } 276 }
277 return this.i18n('aboutUpgradeUpdating'); 277 return this.i18n('aboutUpgradeUpdating');
278 default: 278 default:
279 function formatMessage(msg) { 279 function formatMessage(msg) {
280 return '<div>' + 280 return parseHtmlSubset(
281 parseHtmlSubset('<b>' + msg + '</b>').firstChild.innerHTML + 281 '<b>' + msg + '</b>', ['br', 'pre']).firstChild.innerHTML;
282 '</div>';
283 } 282 }
284 var result = ''; 283 var result = '';
285 var message = this.currentUpdateStatusEvent_.message; 284 var message = this.currentUpdateStatusEvent_.message;
286 if (!!message) 285 if (message)
287 result += formatMessage(message); 286 result += formatMessage(message);
288 var connectMessage = this.currentUpdateStatusEvent_.connectionTypes; 287 var connectMessage = this.currentUpdateStatusEvent_.connectionTypes;
289 if (!!connectMessage) 288 if (connectMessage)
290 result += formatMessage(connectMessage); 289 result += '<div>' + formatMessage(connectMessage) + '</div>';
291 return result; 290 return result;
292 } 291 }
293 }, 292 },
294 293
295 /** 294 /**
296 * @return {?string} 295 * @return {?string}
297 * @private 296 * @private
298 */ 297 */
299 getIcon_: function() { 298 getIcon_: function() {
300 // If this platform has reached the end of the line, display an error icon 299 // If this platform has reached the end of the line, display an error icon
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 }); 409 });
411 }, 410 },
412 411
413 // <if expr="_google_chrome"> 412 // <if expr="_google_chrome">
414 /** @private */ 413 /** @private */
415 onReportIssueTap_: function() { 414 onReportIssueTap_: function() {
416 this.aboutBrowserProxy_.openFeedbackDialog(); 415 this.aboutBrowserProxy_.openFeedbackDialog();
417 }, 416 },
418 // </if> 417 // </if>
419 }); 418 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/about_page/about_page.html ('k') | chrome/test/data/webui/settings/about_page_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698