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

Unified Diff: chrome/browser/resources/net_internals/chromeos_view.js

Issue 11415148: Adding error handling to ONC validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@extract_onc_certificate
Patch Set: Initial patch. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/net_internals/chromeos_view.js
diff --git a/chrome/browser/resources/net_internals/chromeos_view.js b/chrome/browser/resources/net_internals/chromeos_view.js
index 344b0e72d1a992faad1624b51f7f3b08c1542fb1..b0c91b1f34523748c0764d7bd6dd7d7207ae3d2e 100644
--- a/chrome/browser/resources/net_internals/chromeos_view.js
+++ b/chrome/browser/resources/net_internals/chromeos_view.js
@@ -33,7 +33,7 @@ var CrosView = (function() {
if (fileContent)
g_browser.importONCFile(fileContent, passcode);
else
- setParseStatus_('ONC file parse failed: cannot read file');
+ setParseStatus_('ONC file parse failed: cannot read file', false);
clearFileInput_();
}
@@ -90,7 +90,7 @@ var CrosView = (function() {
*
* @private
*/
- function clearParseStatus_(error) {
+ function clearParseStatus_() {
var parseStatus = $(CrosView.PARSE_STATUS_ID);
parseStatus.hidden = true;
parseStatus.textContent = '';
@@ -101,11 +101,22 @@ var CrosView = (function() {
*
* @private
*/
- function setParseStatus_(error) {
+ function setParseStatus_(message, success) {
var parseStatus = $(CrosView.PARSE_STATUS_ID);
parseStatus.hidden = false;
- parseStatus.textContent = error ?
- 'ONC file parse failed: ' + error : 'ONC file successfully parsed';
+
+ if (success) {
+ if (message) {
+ message = 'ONC file parsed and imported, however with warnings:\n' +
+ message;
+ } else {
+ message = 'ONC file parsed and imported.';
+ }
+ } else {
+ message = 'ONC file parse failed:\n' + message;
+ }
+
+ parseStatus.innerHTML = message.replace(/\n/g, '<br>');
reset_();
}

Powered by Google App Engine
This is Rietveld 408576698