| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 _htmlView: function() | 76 _htmlView: function() |
| 77 { | 77 { |
| 78 var dataURL = this.request.asDataURL(); | 78 var dataURL = this.request.asDataURL(); |
| 79 if (dataURL !== null) | 79 if (dataURL !== null) |
| 80 return new WebInspector.RequestHTMLView(this.request, dataURL); | 80 return new WebInspector.RequestHTMLView(this.request, dataURL); |
| 81 }, | 81 }, |
| 82 | 82 |
| 83 _createPreviewView: function() | 83 _createPreviewView: function() |
| 84 { | 84 { |
| 85 if (this.request.content) { | 85 if (this.request.content) { |
| 86 if (this.request.mimeType === "application/json") { | 86 var jsonMediaTypeRE = /^application\/[^;]*\+json/; |
| 87 if (this.request.mimeType === "application/json" || jsonMediaTypeRE.
test(this.request.mimeType)) { |
| 87 var jsonView = this._jsonView(); | 88 var jsonView = this._jsonView(); |
| 88 if (jsonView) | 89 if (jsonView) |
| 89 return jsonView; | 90 return jsonView; |
| 90 } | 91 } |
| 91 | 92 |
| 92 if (this.request.hasErrorStatusCode()) { | 93 if (this.request.hasErrorStatusCode()) { |
| 93 var htmlView = this._htmlView(); | 94 var htmlView = this._htmlView(); |
| 94 if (htmlView) | 95 if (htmlView) |
| 95 return htmlView; | 96 return htmlView; |
| 96 } | 97 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 112 return this._responseView.sourceView; | 113 return this._responseView.sourceView; |
| 113 | 114 |
| 114 if (this.request.type === WebInspector.resourceTypes.Other) | 115 if (this.request.type === WebInspector.resourceTypes.Other) |
| 115 return this._createEmptyView(); | 116 return this._createEmptyView(); |
| 116 | 117 |
| 117 return WebInspector.RequestView.nonSourceViewForRequest(this.request); | 118 return WebInspector.RequestView.nonSourceViewForRequest(this.request); |
| 118 }, | 119 }, |
| 119 | 120 |
| 120 __proto__: WebInspector.RequestContentView.prototype | 121 __proto__: WebInspector.RequestContentView.prototype |
| 121 } | 122 } |
| OLD | NEW |