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

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

Issue 1899893003: [Devtools] JSONView implements Searchable interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * @return {string} 95 * @return {string}
96 */ 96 */
97 _requestContent: function() 97 _requestContent: function()
98 { 98 {
99 var content = this.request.content; 99 var content = this.request.content;
100 return this.request.contentEncoded ? window.atob(content || "") : (conte nt || ""); 100 return this.request.contentEncoded ? window.atob(content || "") : (conte nt || "");
101 }, 101 },
102 102
103 /** 103 /**
104 * @param {?WebInspector.ParsedJSON} parsedJSON 104 * @param {?WebInspector.ParsedJSON} parsedJSON
105 * @return {?WebInspector.JSONView} 105 * @return {?WebInspector.SearchableView}
106 */ 106 */
107 _jsonView: function(parsedJSON) 107 _jsonView: function(parsedJSON)
108 { 108 {
109 if (!parsedJSON || typeof parsedJSON.data !== "object") 109 if (!parsedJSON || typeof parsedJSON.data !== "object")
110 return null; 110 return null;
111 return new WebInspector.JSONView(/** @type {!WebInspector.ParsedJSON} */ (parsedJSON)); 111 var jsonView = new WebInspector.JSONView(/** @type {!WebInspector.Parsed JSON} */ (parsedJSON));
112 return jsonView.makeSearchable();
112 }, 113 },
113 114
114 /** 115 /**
115 * @return {?WebInspector.XMLView} 116 * @return {?WebInspector.XMLView}
116 */ 117 */
117 _xmlView: function() 118 _xmlView: function()
118 { 119 {
119 var content = this._requestContent(); 120 var content = this._requestContent();
120 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type); 121 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type);
121 return parsedXML ? new WebInspector.XMLView(parsedXML) : null; 122 return parsedXML ? new WebInspector.XMLView(parsedXML) : null;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 178
178 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) 179 if (this.request.resourceType() === WebInspector.resourceTypes.Other )
179 return this._createEmptyWidget(); 180 return this._createEmptyWidget();
180 181
181 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); 182 return WebInspector.RequestView.nonSourceViewForRequest(this.request );
182 } 183 }
183 }, 184 },
184 185
185 __proto__: WebInspector.RequestContentView.prototype 186 __proto__: WebInspector.RequestContentView.prototype
186 } 187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698