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

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.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: 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 }, 852 },
853 853
854 jumpToPreviousSearchResult: function() 854 jumpToPreviousSearchResult: function()
855 { 855 {
856 if (!this._searchResults || !this._searchResults.length) 856 if (!this._searchResults || !this._searchResults.length)
857 return; 857 return;
858 var index = this._selectedSearchResult ? this._searchResults.indexOf(thi s._selectedSearchResult) : 0; 858 var index = this._selectedSearchResult ? this._searchResults.indexOf(thi s._selectedSearchResult) : 0;
859 this._jumpToSearchResult(index - 1); 859 this._jumpToSearchResult(index - 1);
860 }, 860 },
861 861
862 /**
863 * @return {boolean}
864 */
865 supportsCaseSensitiveSearch: function()
866 {
867 return false;
868 },
869
870 /**
871 * @return {boolean}
872 */
873 supportsRegexSearch: function()
874 {
875 return false;
876 },
877
862 _jumpToSearchResult: function(index) 878 _jumpToSearchResult: function(index)
863 { 879 {
864 this._selectSearchResult((index + this._searchResults.length) % this._se archResults.length); 880 this._selectSearchResult((index + this._searchResults.length) % this._se archResults.length);
865 this._currentViews[0].highlightSearchResult(this._selectedSearchResult, this._searchRegex, true); 881 this._currentViews[0].highlightSearchResult(this._selectedSearchResult, this._searchRegex, true);
866 }, 882 },
867 883
868 _selectSearchResult: function(index) 884 _selectSearchResult: function(index)
869 { 885 {
870 this._selectedSearchResult = this._searchResults[index]; 886 this._selectedSearchResult = this._searchResults[index];
871 this._searchableView.updateCurrentMatchIndex(index); 887 this._searchableView.updateCurrentMatchIndex(index);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 952
937 searchCanceled: function() 953 searchCanceled: function()
938 { 954 {
939 this._clearHighlight(); 955 this._clearHighlight();
940 delete this._searchResults; 956 delete this._searchResults;
941 delete this._selectedSearchResult; 957 delete this._selectedSearchResult;
942 delete this._searchRegex; 958 delete this._searchRegex;
943 }, 959 },
944 960
945 /** 961 /**
946 * @param {string} query 962 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
947 * @param {boolean} shouldJump 963 * @param {boolean} shouldJump
948 * @param {boolean=} jumpBackwards 964 * @param {boolean=} jumpBackwards
949 */ 965 */
950 performSearch: function(query, shouldJump, jumpBackwards) 966 performSearch: function(searchConfig, shouldJump, jumpBackwards)
951 { 967 {
968 var query = searchConfig.query;
952 this._searchRegex = createPlainTextSearchRegex(query, "i"); 969 this._searchRegex = createPlainTextSearchRegex(query, "i");
953 delete this._searchResults; 970 delete this._searchResults;
954 this._updateSearchHighlight(true, shouldJump, jumpBackwards); 971 this._updateSearchHighlight(true, shouldJump, jumpBackwards);
955 }, 972 },
956 973
957 _updateSelectionDetails: function() 974 _updateSelectionDetails: function()
958 { 975 {
959 if (!this._selection) { 976 if (!this._selection) {
960 this._updateSelectedRangeStats(); 977 this._updateSelectedRangeStats();
961 return; 978 return;
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 1472
1456 WebInspector.TimelinePanelFactory.prototype = { 1473 WebInspector.TimelinePanelFactory.prototype = {
1457 /** 1474 /**
1458 * @return {!WebInspector.Panel} 1475 * @return {!WebInspector.Panel}
1459 */ 1476 */
1460 createPanel: function() 1477 createPanel: function()
1461 { 1478 {
1462 return WebInspector.TimelinePanel._instance(); 1479 return WebInspector.TimelinePanel._instance();
1463 } 1480 }
1464 } 1481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698