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

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, 10 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..9692ac05cadd9003142ab12e12a7b9097f413fae 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);
+ 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);
}
/**
@@ -59,12 +50,11 @@ Resources.StorageItemsView = class extends UI.VBox {
contextMenu.show();
}
-
/**
* @param {!Common.Event} event
*/
_filterChanged(event) {
- var text = this._textFilterUI.value();
+ var text = /** @type {?string} */ (event.data);
this._filterRegex = text ? new RegExp(text.escapeForRegExp(), 'i') : null;
this.refreshItems();
}
@@ -89,13 +79,6 @@ Resources.StorageItemsView = class extends UI.VBox {
}
/**
- * @override
- */
- willHide() {
- this.setCanDeleteSelected(false);
- }
-
- /**
* @param {boolean} enabled
* @protected
*/
@@ -124,7 +107,7 @@ Resources.StorageItemsView = class extends UI.VBox {
* @protected
*/
setCanFilter(enabled) {
- this._filterButton.setEnabled(enabled);
+ this._filterItem.setEnabled(enabled);
}
deleteAllItems() {

Powered by Google App Engine
This is Rietveld 408576698