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

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

Issue 2902673003: Added a refresh database button on the IndexedDB view. (Closed)
Patch Set: Removed model and test line Created 3 years, 7 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/IndexedDBViews.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js
index eb45a9498ee74c960806e670e1cb677b99528fbe..b92ee11b707f3242e631a820b276bd074769ad9d 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js
@@ -53,12 +53,17 @@ Resources.IDBDatabaseView = class extends UI.VBox {
Common.UIString('Delete database'), () => this._deleteDatabase(), Common.UIString('Delete database'));
footer.appendChild(this._clearButton);
+ this._refreshButton = UI.createTextButton(
+ Common.UIString('Refresh database'), () => this._refreshDatabase(), Common.UIString('Refresh database'));
+ footer.appendChild(this._refreshButton);
+
this.update(database);
}
_refreshDatabase() {
this._securityOriginElement.textContent = this._database.databaseId.securityOrigin;
this._versionElement.textContent = this._database.version;
+ this._model.refreshDatabaseView(this._database.databaseId);
}
/**
@@ -104,6 +109,8 @@ Resources.IDBDataView = class extends UI.SimpleView {
this._clearButton = new UI.ToolbarButton(Common.UIString('Clear object store'), 'largeicon-clear');
this._clearButton.addEventListener(UI.ToolbarButton.Events.Click, this._clearButtonClicked, this);
+ this._model.addEventListener(Resources.IndexedDBModel.Events.DatabaseRefreshed, this._databaseRefreshed, this);
+
this._pageSize = 50;
this._skipCount = 0;
@@ -195,6 +202,11 @@ Resources.IDBDataView = class extends UI.SimpleView {
this._keyInputElement.addEventListener('keydown', this._keyInputChanged.bind(this), false);
}
+ _databaseRefreshed(event) {
+ if (this._databaseId === event.data.databaseId)
+ this._updateData(true);
+ }
+
/**
* @param {!Common.Event} event
*/

Powered by Google App Engine
This is Rietveld 408576698