| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 * @param {function(!WebInspector.Widget)} callback | 141 * @param {function(!WebInspector.Widget)} callback |
| 142 */ | 142 */ |
| 143 _createPreviewView: function(callback) | 143 _createPreviewView: function(callback) |
| 144 { | 144 { |
| 145 if (this.request.contentError()) { | 145 if (this.request.contentError()) { |
| 146 callback(this._createMessageView(WebInspector.UIString("Failed to lo
ad response data"))); | 146 callback(this._createMessageView(WebInspector.UIString("Failed to lo
ad response data"))); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 var xmlView = this._xmlView(); | 150 var xmlView = this._xmlView(); |
| 151 if (xmlView) | 151 if (xmlView) { |
| 152 return xmlView; | 152 callback(xmlView); |
| 153 return; |
| 154 } |
| 153 | 155 |
| 154 WebInspector.JSONView.parseJSON(this._requestContent()).then(chooseView.
bind(this)).then(callback); | 156 WebInspector.JSONView.parseJSON(this._requestContent()).then(chooseView.
bind(this)).then(callback); |
| 155 | 157 |
| 156 /** | 158 /** |
| 157 * @this {WebInspector.RequestPreviewView} | 159 * @this {WebInspector.RequestPreviewView} |
| 158 * @param {?WebInspector.ParsedJSON} jsonData | 160 * @param {?WebInspector.ParsedJSON} jsonData |
| 159 * @return {!WebInspector.Widget} | 161 * @return {!WebInspector.Widget} |
| 160 */ | 162 */ |
| 161 function chooseView(jsonData) | 163 function chooseView(jsonData) |
| 162 { | 164 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 177 | 179 |
| 178 if (this.request.resourceType() === WebInspector.resourceTypes.Other
) | 180 if (this.request.resourceType() === WebInspector.resourceTypes.Other
) |
| 179 return this._createEmptyWidget(); | 181 return this._createEmptyWidget(); |
| 180 | 182 |
| 181 return WebInspector.RequestView.nonSourceViewForRequest(this.request
); | 183 return WebInspector.RequestView.nonSourceViewForRequest(this.request
); |
| 182 } | 184 } |
| 183 }, | 185 }, |
| 184 | 186 |
| 185 __proto__: WebInspector.RequestContentView.prototype | 187 __proto__: WebInspector.RequestContentView.prototype |
| 186 } | 188 } |
| OLD | NEW |