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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js

Issue 1942683006: [Devtools] XMLView now searchable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FIND_IN_JSON_FINAL
Patch Set: Fixed nit Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
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
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 parsedXML = WebInspector.XMLView.parseXML(this._requestContent(), th is.request.mimeType);
129 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type); 129 return parsedXML ? WebInspector.XMLView.createSearchableView(parsedXML) : null;
130 return parsedXML ? new WebInspector.XMLView(parsedXML) : null;
131 }, 130 },
132 131
133 /** 132 /**
134 * @return {?WebInspector.RequestHTMLView} 133 * @return {?WebInspector.RequestHTMLView}
135 */ 134 */
136 _htmlErrorPreview: function() 135 _htmlErrorPreview: function()
137 { 136 {
138 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; 137 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"];
139 if (whitelist.indexOf(this.request.mimeType) === -1) 138 if (whitelist.indexOf(this.request.mimeType) === -1)
140 return null; 139 return null;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 187
189 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) 188 if (this.request.resourceType() === WebInspector.resourceTypes.Other )
190 return this._createEmptyWidget(); 189 return this._createEmptyWidget();
191 190
192 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); 191 return WebInspector.RequestView.nonSourceViewForRequest(this.request );
193 } 192 }
194 }, 193 },
195 194
196 __proto__: WebInspector.RequestContentView.prototype 195 __proto__: WebInspector.RequestContentView.prototype
197 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698