| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 _createMessageView: function(message) | 74 _createMessageView: function(message) |
| 75 { | 75 { |
| 76 return new WebInspector.EmptyView(message); | 76 return new WebInspector.EmptyView(message); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * @return {?WebInspector.RequestJSONView} | 80 * @return {?WebInspector.RequestJSONView} |
| 81 */ | 81 */ |
| 82 _jsonView: function() | 82 _jsonView: function() |
| 83 { | 83 { |
| 84 var parsedJSON = WebInspector.RequestJSONView.parseJSON(this.request.con
tent || ""); | 84 var request = this.request; |
| 85 var content = request.content; |
| 86 content = request.contentEncoded ? window.atob(content || "") : (content
|| ""); |
| 87 var parsedJSON = WebInspector.RequestJSONView.parseJSON(content); |
| 85 return parsedJSON ? new WebInspector.RequestJSONView(this.request, parse
dJSON) : null; | 88 return parsedJSON ? new WebInspector.RequestJSONView(this.request, parse
dJSON) : null; |
| 86 }, | 89 }, |
| 87 | 90 |
| 88 /** | 91 /** |
| 89 * @return {?WebInspector.RequestHTMLView} | 92 * @return {?WebInspector.RequestHTMLView} |
| 90 */ | 93 */ |
| 91 _htmlErrorPreview: function() | 94 _htmlErrorPreview: function() |
| 92 { | 95 { |
| 93 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; | 96 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; |
| 94 if (whitelist.indexOf(this.request.mimeType) === -1) | 97 if (whitelist.indexOf(this.request.mimeType) === -1) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return this._responseView.sourceView; | 135 return this._responseView.sourceView; |
| 133 | 136 |
| 134 if (this.request.type === WebInspector.resourceTypes.Other) | 137 if (this.request.type === WebInspector.resourceTypes.Other) |
| 135 return this._createEmptyView(); | 138 return this._createEmptyView(); |
| 136 | 139 |
| 137 return WebInspector.RequestView.nonSourceViewForRequest(this.request); | 140 return WebInspector.RequestView.nonSourceViewForRequest(this.request); |
| 138 }, | 141 }, |
| 139 | 142 |
| 140 __proto__: WebInspector.RequestContentView.prototype | 143 __proto__: WebInspector.RequestContentView.prototype |
| 141 } | 144 } |
| OLD | NEW |