Chromium Code Reviews| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 * @return {?WebInspector.SearchableView} | 114 * @return {?WebInspector.SearchableView} |
| 115 */ | 115 */ |
| 116 _jsonView: function(parsedJSON) | 116 _jsonView: function(parsedJSON) |
| 117 { | 117 { |
| 118 if (!parsedJSON || typeof parsedJSON.data !== "object") | 118 if (!parsedJSON || typeof parsedJSON.data !== "object") |
| 119 return null; | 119 return null; |
| 120 return WebInspector.JSONView.createSearchableView(/** @type {!WebInspect or.ParsedJSON} */ (parsedJSON)); | 120 return WebInspector.JSONView.createSearchableView(/** @type {!WebInspect or.ParsedJSON} */ (parsedJSON)); |
| 121 }, | 121 }, |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * @return {?WebInspector.XMLView} | 124 * @return {?WebInspector.SearchableView} |
| 125 */ | 125 */ |
| 126 _xmlView: function() | 126 _xmlView: function() |
| 127 { | 127 { |
| 128 var content = this._requestContent(); | 128 var content = this._requestContent(); |
| 129 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type); | 129 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type); |
| 130 return parsedXML ? new WebInspector.XMLView(parsedXML) : null; | 130 if (parsedXML) |
|
lushnikov
2016/05/16 22:16:05
nit: return parsedXML ? WebInspector.XMLView.creat
| |
| 131 return WebInspector.XMLView.createSearchableView(parsedXML); | |
| 132 return null; | |
| 131 }, | 133 }, |
| 132 | 134 |
| 133 /** | 135 /** |
| 134 * @return {?WebInspector.RequestHTMLView} | 136 * @return {?WebInspector.RequestHTMLView} |
| 135 */ | 137 */ |
| 136 _htmlErrorPreview: function() | 138 _htmlErrorPreview: function() |
| 137 { | 139 { |
| 138 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; | 140 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; |
| 139 if (whitelist.indexOf(this.request.mimeType) === -1) | 141 if (whitelist.indexOf(this.request.mimeType) === -1) |
| 140 return null; | 142 return null; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 190 |
| 189 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) | 191 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) |
| 190 return this._createEmptyWidget(); | 192 return this._createEmptyWidget(); |
| 191 | 193 |
| 192 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); | 194 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); |
| 193 } | 195 } |
| 194 }, | 196 }, |
| 195 | 197 |
| 196 __proto__: WebInspector.RequestContentView.prototype | 198 __proto__: WebInspector.RequestContentView.prototype |
| 197 } | 199 } |
| OLD | NEW |