| OLD | NEW |
| 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 _handleContextMenuEvent(event) { | 1081 _handleContextMenuEvent(event) { |
| 1082 var contextMenu = new UI.ContextMenu(event); | 1082 var contextMenu = new UI.ContextMenu(event); |
| 1083 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this.refreshInd
exedDB.bind(this)); | 1083 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this.refreshInd
exedDB.bind(this)); |
| 1084 contextMenu.show(); | 1084 contextMenu.show(); |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 refreshIndexedDB() { | 1087 refreshIndexedDB() { |
| 1088 for (var indexedDBModel of SDK.targetManager.models(Resources.IndexedDBModel
)) | 1088 for (var indexedDBModel of SDK.targetManager.models(Resources.IndexedDBModel
)) |
| 1089 indexedDBModel.refreshDatabaseNames(); | 1089 indexedDBModel.refreshDatabaseNames(); // Adds IDBDatabaseTreeElements. |
| 1090 for (var i = 0; i < this._idbDatabaseTreeElements.length; ++i) |
| 1091 this._idbDatabaseTreeElements[i]._refreshIndexedDB(); |
| 1090 } | 1092 } |
| 1091 | 1093 |
| 1092 /** | 1094 /** |
| 1093 * @param {!Common.Event} event | 1095 * @param {!Common.Event} event |
| 1094 */ | 1096 */ |
| 1095 _indexedDBAdded(event) { | 1097 _indexedDBAdded(event) { |
| 1096 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.
data.databaseId); | 1098 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.
data.databaseId); |
| 1097 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); | 1099 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); |
| 1098 this._addIndexedDB(model, databaseId); | 1100 this._addIndexedDB(model, databaseId); |
| 1099 } | 1101 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu
Event.bind(this), true); | 1192 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu
Event.bind(this), true); |
| 1191 } | 1193 } |
| 1192 | 1194 |
| 1193 _handleContextMenuEvent(event) { | 1195 _handleContextMenuEvent(event) { |
| 1194 var contextMenu = new UI.ContextMenu(event); | 1196 var contextMenu = new UI.ContextMenu(event); |
| 1195 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn
dexedDB.bind(this)); | 1197 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn
dexedDB.bind(this)); |
| 1196 contextMenu.show(); | 1198 contextMenu.show(); |
| 1197 } | 1199 } |
| 1198 | 1200 |
| 1199 _refreshIndexedDB() { | 1201 _refreshIndexedDB() { |
| 1200 this._model.refreshDatabaseNames(); | 1202 this._model.refreshDatabase(this._databaseId); |
| 1201 } | 1203 } |
| 1202 | 1204 |
| 1203 /** | 1205 /** |
| 1204 * @param {!Resources.IndexedDBModel.Database} database | 1206 * @param {!Resources.IndexedDBModel.Database} database |
| 1205 */ | 1207 */ |
| 1206 update(database) { | 1208 update(database) { |
| 1207 this._database = database; | 1209 this._database = database; |
| 1208 var objectStoreNames = {}; | 1210 var objectStoreNames = {}; |
| 1209 for (var objectStoreName in this._database.objectStores) { | 1211 for (var objectStoreName in this._database.objectStores) { |
| 1210 var objectStore = this._database.objectStores[objectStoreName]; | 1212 var objectStore = this._database.objectStores[objectStoreName]; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1231 _updateTooltip() { | 1233 _updateTooltip() { |
| 1232 this.tooltip = Common.UIString('Version') + ': ' + this._database.version; | 1234 this.tooltip = Common.UIString('Version') + ': ' + this._database.version; |
| 1233 } | 1235 } |
| 1234 | 1236 |
| 1235 /** | 1237 /** |
| 1236 * @override | 1238 * @override |
| 1237 * @return {boolean} | 1239 * @return {boolean} |
| 1238 */ | 1240 */ |
| 1239 onselect(selectedByUser) { | 1241 onselect(selectedByUser) { |
| 1240 super.onselect(selectedByUser); | 1242 super.onselect(selectedByUser); |
| 1241 if (!this._view) | 1243 if (!this._view && this._database) |
| 1242 this._view = new Resources.IDBDatabaseView(this._model, this._database); | 1244 this._view = new Resources.IDBDatabaseView(this._model, this._database); |
| 1243 | 1245 |
| 1244 this.showView(this._view); | 1246 this.showView(this._view); |
| 1245 return false; | 1247 return false; |
| 1246 } | 1248 } |
| 1247 | 1249 |
| 1248 /** | 1250 /** |
| 1249 * @param {string} objectStoreName | 1251 * @param {string} objectStoreName |
| 1250 */ | 1252 */ |
| 1251 _objectStoreRemoved(objectStoreName) { | 1253 _objectStoreRemoved(objectStoreName) { |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 | 1643 |
| 1642 this.element.classList.add('storage-view'); | 1644 this.element.classList.add('storage-view'); |
| 1643 this._emptyWidget = new UI.EmptyWidget(''); | 1645 this._emptyWidget = new UI.EmptyWidget(''); |
| 1644 this._emptyWidget.show(this.element); | 1646 this._emptyWidget.show(this.element); |
| 1645 } | 1647 } |
| 1646 | 1648 |
| 1647 setText(text) { | 1649 setText(text) { |
| 1648 this._emptyWidget.text = text; | 1650 this._emptyWidget.text = text; |
| 1649 } | 1651 } |
| 1650 }; | 1652 }; |
| OLD | NEW |