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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js

Issue 2662403002: [DevTools] Merge filter bar with the main toolbar (Closed)
Patch Set: [DevTools] Merge filter bar with the main toolbar Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js
index a404165c4502fad3ab69bf81fc3cd935afa9321a..98b99f355e7f40a4cd0356ffff2913aab891ac4b 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/StorageItemsView.js
@@ -12,30 +12,21 @@ Resources.StorageItemsView = class extends UI.VBox {
/** @type {?RegExp} */
this._filterRegex = null;
- this._filterBar = new UI.FilterBar(filterName, true);
- this._textFilterUI = new UI.TextFilterUI(false);
- this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._filterChanged, this);
- this._filterBar.addFilter(this._textFilterUI);
-
this._deleteAllButton = this._addButton(Common.UIString('Clear All'), 'largeicon-clear', this.deleteAllItems);
this._deleteSelectedButton =
this._addButton(Common.UIString('Delete Selected'), 'largeicon-delete', this.deleteSelectedItem);
this._refreshButton = this._addButton(Common.UIString('Refresh'), 'largeicon-refresh', this.refreshItems);
- this._filterButton = this._filterBar.filterButton();
this._mainToolbar = new UI.Toolbar('top-resources-toolbar', this.element);
- var toolbarItems = [
- this._refreshButton, this._deleteAllButton, this._deleteSelectedButton, new UI.ToolbarSeparator(),
- this._filterButton
- ];
-
- this.element.addEventListener('contextmenu', this._showContextMenu.bind(this), true);
-
+ this._filterItem = new UI.ToolbarInput(Common.UIString('Filter'), 0.4, undefined, true);
+ this._filterItem.addEventListener(UI.ToolbarInput.Event.TextChanged, this._filterChanged, this);
+ this._filterItem.addEventListener(UI.ToolbarInput.Event.FocusOnResultsRequested, this.focusGrid, this);
+ var toolbarItems = [this._refreshButton, this._deleteAllButton, this._deleteSelectedButton, this._filterItem];
for (var item of toolbarItems)
this._mainToolbar.appendToolbarItem(item);
- this._filterBar.show(this.element);
+ this.element.addEventListener('contextmenu', this._showContextMenu.bind(this), true);
}
/**
@@ -64,7 +55,7 @@ Resources.StorageItemsView = class extends UI.VBox {
* @param {!Common.Event} event
*/
_filterChanged(event) {
- var text = this._textFilterUI.value();
+ var text = event.data;
this._filterRegex = text ? new RegExp(text.escapeForRegExp(), 'i') : null;
this.refreshItems();
}
@@ -89,13 +80,6 @@ Resources.StorageItemsView = class extends UI.VBox {
}
/**
- * @override
- */
- willHide() {
- this.setCanDeleteSelected(false);
- }
-
- /**
* @param {boolean} enabled
* @protected
*/
@@ -124,7 +108,7 @@ Resources.StorageItemsView = class extends UI.VBox {
* @protected
*/
setCanFilter(enabled) {
- this._filterButton.setEnabled(enabled);
+ this._filterItem.setEnabled(enabled);
}
deleteAllItems() {
@@ -135,4 +119,7 @@ Resources.StorageItemsView = class extends UI.VBox {
refreshItems() {
}
+
+ focusGrid() {
+ }
};

Powered by Google App Engine
This is Rietveld 408576698