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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js

Issue 2914293002: [IndexedDB] [DevTools] Right-click 'Refresh' on database now updates object store view, also fixed … (Closed)
Patch Set: Using await instead Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 * @param {!Resources.IndexedDBModel} model 1169 * @param {!Resources.IndexedDBModel} model
1170 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId 1170 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId
1171 */ 1171 */
1172 constructor(storagePanel, model, databaseId) { 1172 constructor(storagePanel, model, databaseId) {
1173 super(storagePanel, databaseId.name + ' - ' + databaseId.securityOrigin, fal se); 1173 super(storagePanel, databaseId.name + ' - ' + databaseId.securityOrigin, fal se);
1174 this._model = model; 1174 this._model = model;
1175 this._databaseId = databaseId; 1175 this._databaseId = databaseId;
1176 this._idbObjectStoreTreeElements = {}; 1176 this._idbObjectStoreTreeElements = {};
1177 var icon = UI.Icon.create('mediumicon-database', 'resource-tree-item'); 1177 var icon = UI.Icon.create('mediumicon-database', 'resource-tree-item');
1178 this.setLeadingIcons([icon]); 1178 this.setLeadingIcons([icon]);
1179 this._model.addEventListener(Resources.IndexedDBModel.Events.DatabaseNamesRe freshed, this._refreshIndexedDB, this);
1179 } 1180 }
1180 1181
1181 get itemURL() { 1182 get itemURL() {
1182 return 'indexedDB://' + this._databaseId.securityOrigin + '/' + this._databa seId.name; 1183 return 'indexedDB://' + this._databaseId.securityOrigin + '/' + this._databa seId.name;
1183 } 1184 }
1184 1185
1185 /** 1186 /**
1186 * @override 1187 * @override
1187 */ 1188 */
1188 onattach() { 1189 onattach() {
1189 super.onattach(); 1190 super.onattach();
1190 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu Event.bind(this), true); 1191 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu Event.bind(this), true);
1191 } 1192 }
1192 1193
1193 _handleContextMenuEvent(event) { 1194 _handleContextMenuEvent(event) {
1194 var contextMenu = new UI.ContextMenu(event); 1195 var contextMenu = new UI.ContextMenu(event);
1195 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn dexedDB.bind(this)); 1196 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn dexedDB.bind(this));
1196 contextMenu.show(); 1197 contextMenu.show();
1197 } 1198 }
1198 1199
1199 _refreshIndexedDB() { 1200 _refreshIndexedDB() {
1200 this._model.refreshDatabaseNames(); 1201 this._model.refreshDatabase(this._databaseId);
1201 } 1202 }
1202 1203
1203 /** 1204 /**
1204 * @param {!Resources.IndexedDBModel.Database} database 1205 * @param {!Resources.IndexedDBModel.Database} database
1205 */ 1206 */
1206 update(database) { 1207 update(database) {
1207 this._database = database; 1208 this._database = database;
1208 var objectStoreNames = {}; 1209 var objectStoreNames = {};
1209 for (var objectStoreName in this._database.objectStores) { 1210 for (var objectStoreName in this._database.objectStores) {
1210 var objectStore = this._database.objectStores[objectStoreName]; 1211 var objectStore = this._database.objectStores[objectStoreName];
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1637
1637 this.element.classList.add('storage-view'); 1638 this.element.classList.add('storage-view');
1638 this._emptyWidget = new UI.EmptyWidget(''); 1639 this._emptyWidget = new UI.EmptyWidget('');
1639 this._emptyWidget.show(this.element); 1640 this._emptyWidget.show(this.element);
1640 } 1641 }
1641 1642
1642 setText(text) { 1643 setText(text) {
1643 this._emptyWidget.text = text; 1644 this._emptyWidget.text = text;
1644 } 1645 }
1645 }; 1646 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698