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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @unrestricted 32 * @unrestricted
33 */ 33 */
34 Resources.IDBDatabaseView = class extends UI.VBox { 34 Resources.IDBDatabaseView = class extends UI.VBox {
35 /** 35 /**
36 * @param {!Resources.IndexedDBModel} model 36 * @param {!Resources.IndexedDBModel} model
37 * @param {!Resources.IndexedDBModel.Database} database 37 * @param {?Resources.IndexedDBModel.Database} database
38 */ 38 */
39 constructor(model, database) { 39 constructor(model, database) {
40 super(); 40 super();
41 41
42 this._model = model; 42 this._model = model;
43 var databaseName = database ? database.databaseId.name : Common.UIString('Lo ading\u2026');
43 44
44 this._reportView = new UI.ReportView(database.databaseId.name); 45 this._reportView = new UI.ReportView(databaseName);
45 this._reportView.show(this.contentElement); 46 this._reportView.show(this.contentElement);
46 47
47 var bodySection = this._reportView.appendSection(''); 48 var bodySection = this._reportView.appendSection('');
48 this._securityOriginElement = bodySection.appendField(Common.UIString('Secur ity origin')); 49 this._securityOriginElement = bodySection.appendField(Common.UIString('Secur ity origin'));
49 this._versionElement = bodySection.appendField(Common.UIString('Version')); 50 this._versionElement = bodySection.appendField(Common.UIString('Version'));
50 51
51 var footer = this._reportView.appendSection('').appendRow(); 52 var footer = this._reportView.appendSection('').appendRow();
52 this._clearButton = UI.createTextButton( 53 this._clearButton = UI.createTextButton(
53 Common.UIString('Delete database'), () => this._deleteDatabase(), Common .UIString('Delete database')); 54 Common.UIString('Delete database'), () => this._deleteDatabase(), Common .UIString('Delete database'));
54 footer.appendChild(this._clearButton); 55 footer.appendChild(this._clearButton);
55 56
56 this._refreshButton = UI.createTextButton( 57 this._refreshButton = UI.createTextButton(
57 Common.UIString('Refresh database'), () => this._refreshDatabaseButtonCl icked(), 58 Common.UIString('Refresh database'), () => this._refreshDatabaseButtonCl icked(),
58 Common.UIString('Refresh database')); 59 Common.UIString('Refresh database'));
59 footer.appendChild(this._refreshButton); 60 footer.appendChild(this._refreshButton);
60 61
61 this.update(database); 62 if (database)
63 this.update(database);
62 } 64 }
63 65
64 _refreshDatabase() { 66 _refreshDatabase() {
65 this._securityOriginElement.textContent = this._database.databaseId.security Origin; 67 this._securityOriginElement.textContent = this._database.databaseId.security Origin;
66 this._versionElement.textContent = this._database.version; 68 this._versionElement.textContent = this._database.version;
67 } 69 }
68 70
69 _refreshDatabaseButtonClicked() { 71 _refreshDatabaseButtonClicked() {
70 this._model.refreshDatabase(this._database.databaseId); 72 this._model.refreshDatabase(this._database.databaseId);
71 } 73 }
72 74
73 /** 75 /**
74 * @param {!Resources.IndexedDBModel.Database} database 76 * @param {!Resources.IndexedDBModel.Database} database
75 */ 77 */
76 update(database) { 78 update(database) {
77 this._database = database; 79 this._database = database;
80 this._reportView.setTitle(this._database.databaseId.name);
78 this._refreshDatabase(); 81 this._refreshDatabase();
79 this._updatedForTests(); 82 this._updatedForTests();
80 } 83 }
81 84
82 _updatedForTests() { 85 _updatedForTests() {
83 // Sniffed in tests. 86 // Sniffed in tests.
84 } 87 }
85 88
86 _deleteDatabase() { 89 _deleteDatabase() {
87 UI.ConfirmDialog.show( 90 UI.ConfirmDialog.show(
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 cell.removeChildren(); 383 cell.removeChildren();
381 var objectElement = ObjectUI.ObjectPropertiesSection.defaultObjectPresen tation(value, undefined, true); 384 var objectElement = ObjectUI.ObjectPropertiesSection.defaultObjectPresen tation(value, undefined, true);
382 cell.appendChild(objectElement); 385 cell.appendChild(objectElement);
383 break; 386 break;
384 default: 387 default:
385 } 388 }
386 389
387 return cell; 390 return cell;
388 } 391 }
389 }; 392 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698