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

Unified Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 696703003: DevTools: implement search for CPUProfiler FlameChart view (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test was rebaselined Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/profiler/ProfilesPanel.js
diff --git a/Source/devtools/front_end/profiler/ProfilesPanel.js b/Source/devtools/front_end/profiler/ProfilesPanel.js
index 3e0ab77330d7d6045af0c07c5ff159c90d70981a..73773bbda237b7d4d2fb00ab231b1e016e2a58d7 100644
--- a/Source/devtools/front_end/profiler/ProfilesPanel.js
+++ b/Source/devtools/front_end/profiler/ProfilesPanel.js
@@ -431,7 +431,6 @@ WebInspector.ProfileHeader.prototype = {
/**
* @constructor
- * @implements {WebInspector.Searchable}
* @implements {WebInspector.ProfileType.DataDisplayDelegate}
* @extends {WebInspector.PanelWithSidebarTree}
*/
@@ -442,10 +441,7 @@ WebInspector.ProfilesPanel = function()
this.registerRequiredCSS("profiler/heapProfiler.css");
this.registerRequiredCSS("profiler/profilesPanel.css");
- this._searchableView = new WebInspector.SearchableView(this);
-
var mainView = new WebInspector.VBox();
- this._searchableView.show(mainView.element);
mainView.show(this.mainElement());
this.profilesItemTreeElement = new WebInspector.ProfilesSidebarTreeElement(this);
@@ -455,7 +451,7 @@ WebInspector.ProfilesPanel = function()
this.profileViews = createElement("div");
this.profileViews.id = "profile-views";
this.profileViews.classList.add("vbox");
- this._searchableView.element.appendChild(this.profileViews);
+ mainView.element.appendChild(this.profileViews);
var statusBarContainer = createElementWithClass("div", "profiles-status-bar");
mainView.element.insertBefore(statusBarContainer, mainView.element.firstChild);
@@ -499,11 +495,11 @@ WebInspector.ProfilesPanel = function()
WebInspector.ProfilesPanel.prototype = {
/**
- * @return {!WebInspector.SearchableView}
+ * @return {?WebInspector.SearchableView}
*/
searchableView: function()
{
- return this._searchableView;
+ return this.visibleView.searchableView();
},
_createFileSelectorElement: function()
@@ -638,8 +634,6 @@ WebInspector.ProfilesPanel.prototype = {
types[i]._reset();
delete this.visibleView;
- delete this.currentQuery;
- this.searchCanceled();
this._profileGroups = {};
this._updateRecordButton(false);
@@ -871,89 +865,6 @@ WebInspector.ProfilesPanel.prototype = {
},
/**
- * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
- * @param {boolean} shouldJump
- * @param {boolean=} jumpBackwards
- */
- performSearch: function(searchConfig, shouldJump, jumpBackwards)
- {
- var query = searchConfig.query;
- this.searchCanceled();
-
- var visibleView = this.visibleView;
- if (!visibleView)
- return;
-
- /**
- * @this {WebInspector.ProfilesPanel}
- */
- function finishedCallback(view, searchMatches)
- {
- if (!searchMatches)
- return;
- this._searchableView.updateSearchMatchesCount(searchMatches);
- this._searchResultsView = view;
- if (shouldJump) {
- if (jumpBackwards)
- view.jumpToLastSearchResult();
- else
- view.jumpToFirstSearchResult();
- this._searchableView.updateCurrentMatchIndex(view.currentSearchResultIndex());
- }
- }
-
- visibleView.currentQuery = query;
- visibleView.performSearch(query, finishedCallback.bind(this));
- },
-
- jumpToNextSearchResult: function()
- {
- if (!this._searchResultsView)
- return;
- if (this._searchResultsView !== this.visibleView)
- return;
- this._searchResultsView.jumpToNextSearchResult();
- this._searchableView.updateCurrentMatchIndex(this._searchResultsView.currentSearchResultIndex());
- },
-
- jumpToPreviousSearchResult: function()
- {
- if (!this._searchResultsView)
- return;
- if (this._searchResultsView !== this.visibleView)
- return;
- this._searchResultsView.jumpToPreviousSearchResult();
- this._searchableView.updateCurrentMatchIndex(this._searchResultsView.currentSearchResultIndex());
- },
-
- /**
- * @return {boolean}
- */
- supportsCaseSensitiveSearch: function()
- {
- return false;
- },
-
- /**
- * @return {boolean}
- */
- supportsRegexSearch: function()
- {
- return false;
- },
-
- searchCanceled: function()
- {
- if (this._searchResultsView) {
- if (this._searchResultsView.searchCanceled)
- this._searchResultsView.searchCanceled();
- this._searchResultsView.currentQuery = null;
- this._searchResultsView = null;
- }
- this._searchableView.updateSearchMatchesCount(0);
- },
-
- /**
* @param {!Event} event
* @param {!WebInspector.ContextMenu} contextMenu
* @param {!Object} target

Powered by Google App Engine
This is Rietveld 408576698