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

Side by Side Diff: Source/devtools/front_end/network/NetworkPanel.js

Issue 658403002: DevTools: Support regex search and case sensitive search in sources panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 WebInspector.Revealer.reveal(request); 1396 WebInspector.Revealer.reveal(request);
1397 var highlightedSubstringChanges = node.highlightMatchedSubstring(regExp) ; 1397 var highlightedSubstringChanges = node.highlightMatchedSubstring(regExp) ;
1398 this._highlightedSubstringChanges.push(highlightedSubstringChanges); 1398 this._highlightedSubstringChanges.push(highlightedSubstringChanges);
1399 1399
1400 this._currentMatchedRequestNode = node; 1400 this._currentMatchedRequestNode = node;
1401 this._currentMatchedRequestIndex = n; 1401 this._currentMatchedRequestIndex = n;
1402 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Sea rchIndexUpdated, n); 1402 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Sea rchIndexUpdated, n);
1403 }, 1403 },
1404 1404
1405 /** 1405 /**
1406 * @param {string} query 1406 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
1407 * @param {boolean} shouldJump 1407 * @param {boolean} shouldJump
1408 * @param {boolean=} jumpBackwards 1408 * @param {boolean=} jumpBackwards
1409 */ 1409 */
1410 performSearch: function(query, shouldJump, jumpBackwards) 1410 performSearch: function(searchConfig, shouldJump, jumpBackwards)
1411 { 1411 {
1412 var query = searchConfig.query;
1412 var currentMatchedRequestNode = this._currentMatchedRequestNode; 1413 var currentMatchedRequestNode = this._currentMatchedRequestNode;
1413 this._clearSearchMatchedList(); 1414 this._clearSearchMatchedList();
1414 this._searchRegExp = createPlainTextSearchRegex(query, "i"); 1415 this._searchRegExp = createPlainTextSearchRegex(query, "i");
1415 1416
1416 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ 1417 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */
1417 var nodes = this._dataGrid.rootNode().children; 1418 var nodes = this._dataGrid.rootNode().children;
1418 for (var i = 0; i < nodes.length; ++i) 1419 for (var i = 0; i < nodes.length; ++i)
1419 nodes[i]._isMatchingSearchQuery = this._matchRequest(nodes[i].reques t()); 1420 nodes[i]._isMatchingSearchQuery = this._matchRequest(nodes[i].reques t());
1420 var newMatchedRequestIndex = this._updateMatchCountAndFindMatchIndex(cur rentMatchedRequestNode); 1421 var newMatchedRequestIndex = this._updateMatchCountAndFindMatchIndex(cur rentMatchedRequestNode);
1421 if (!newMatchedRequestIndex && jumpBackwards) 1422 if (!newMatchedRequestIndex && jumpBackwards)
1422 newMatchedRequestIndex = this._matchedRequestCount - 1; 1423 newMatchedRequestIndex = this._matchedRequestCount - 1;
1423 this._highlightNthMatchedRequestForSearch(newMatchedRequestIndex, should Jump); 1424 this._highlightNthMatchedRequestForSearch(newMatchedRequestIndex, should Jump);
1424 }, 1425 },
1425 1426
1426 /** 1427 /**
1428 * @return {boolean}
1429 */
1430 supportsCaseSensitiveSearch: function()
1431 {
1432 return false;
1433 },
1434
1435 /**
1436 * @return {boolean}
1437 */
1438 supportsRegexSearch: function()
1439 {
1440 return false;
1441 },
1442
1443 /**
1427 * @param {?WebInspector.NetworkDataGridNode} node 1444 * @param {?WebInspector.NetworkDataGridNode} node
1428 * @return {number} 1445 * @return {number}
1429 */ 1446 */
1430 _updateMatchCountAndFindMatchIndex: function(node) 1447 _updateMatchCountAndFindMatchIndex: function(node)
1431 { 1448 {
1432 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ 1449 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */
1433 var nodes = this._dataGrid.rootNode().children; 1450 var nodes = this._dataGrid.rootNode().children;
1434 var matchCount = 0; 1451 var matchCount = 0;
1435 var matchIndex = 0; 1452 var matchIndex = 0;
1436 for (var i = 0; i < nodes.length; ++i) { 1453 for (var i = 0; i < nodes.length; ++i) {
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 this._viewingRequestMode = true; 2134 this._viewingRequestMode = true;
2118 2135
2119 this.element.classList.add("viewing-resource"); 2136 this.element.classList.add("viewing-resource");
2120 this._splitView.showBoth(); 2137 this._splitView.showBoth();
2121 this._networkLogView.setAllowPopover(false); 2138 this._networkLogView.setAllowPopover(false);
2122 this._networkLogView._allowRequestSelection = true; 2139 this._networkLogView._allowRequestSelection = true;
2123 this._networkLogView.switchViewMode(false); 2140 this._networkLogView.switchViewMode(false);
2124 }, 2141 },
2125 2142
2126 /** 2143 /**
2127 * @param {string} query 2144 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
2128 * @param {boolean} shouldJump 2145 * @param {boolean} shouldJump
2129 * @param {boolean=} jumpBackwards 2146 * @param {boolean=} jumpBackwards
2130 */ 2147 */
2131 performSearch: function(query, shouldJump, jumpBackwards) 2148 performSearch: function(searchConfig, shouldJump, jumpBackwards)
2132 { 2149 {
2133 this._networkLogView.performSearch(query, shouldJump, jumpBackwards); 2150 this._networkLogView.performSearch(searchConfig, shouldJump, jumpBackwar ds);
2134 }, 2151 },
2135 2152
2136 jumpToPreviousSearchResult: function() 2153 jumpToPreviousSearchResult: function()
2137 { 2154 {
2138 this._networkLogView.jumpToPreviousSearchResult(); 2155 this._networkLogView.jumpToPreviousSearchResult();
2139 }, 2156 },
2140 2157
2158 /**
2159 * @return {boolean}
2160 */
2161 supportsCaseSensitiveSearch: function()
2162 {
2163 return false;
2164 },
2165
2166 /**
2167 * @return {boolean}
2168 */
2169 supportsRegexSearch: function()
2170 {
2171 return false;
2172 },
2173
2141 jumpToNextSearchResult: function() 2174 jumpToNextSearchResult: function()
2142 { 2175 {
2143 this._networkLogView.jumpToNextSearchResult(); 2176 this._networkLogView.jumpToNextSearchResult();
2144 }, 2177 },
2145 2178
2146 searchCanceled: function() 2179 searchCanceled: function()
2147 { 2180 {
2148 this._networkLogView.searchCanceled(); 2181 this._networkLogView.searchCanceled();
2149 }, 2182 },
2150 2183
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3270 this._writeProgress.done(); 3303 this._writeProgress.done();
3271 return; 3304 return;
3272 } 3305 }
3273 const chunkSize = 100000; 3306 const chunkSize = 100000;
3274 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize); 3307 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize);
3275 this._bytesWritten += text.length; 3308 this._bytesWritten += text.length;
3276 stream.write(text, this._writeNextChunk.bind(this)); 3309 stream.write(text, this._writeNextChunk.bind(this));
3277 this._writeProgress.setWorked(this._bytesWritten); 3310 this._writeProgress.setWorked(this._bytesWritten);
3278 } 3311 }
3279 } 3312 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/inspectorStyle.css ('k') | Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698