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

Side by Side 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: Fixing trybot failures, wrong security origin in test expected file. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 var bodySection = this._reportView.appendSection(''); 47 var bodySection = this._reportView.appendSection('');
48 this._securityOriginElement = bodySection.appendField(Common.UIString('Secur ity origin')); 48 this._securityOriginElement = bodySection.appendField(Common.UIString('Secur ity origin'));
49 this._versionElement = bodySection.appendField(Common.UIString('Version')); 49 this._versionElement = bodySection.appendField(Common.UIString('Version'));
50 50
51 var footer = this._reportView.appendSection('').appendRow(); 51 var footer = this._reportView.appendSection('').appendRow();
52 this._clearButton = UI.createTextButton( 52 this._clearButton = UI.createTextButton(
53 Common.UIString('Delete database'), () => this._deleteDatabase(), Common .UIString('Delete database')); 53 Common.UIString('Delete database'), () => this._deleteDatabase(), Common .UIString('Delete database'));
54 footer.appendChild(this._clearButton); 54 footer.appendChild(this._clearButton);
55 55
56 this._refreshButton = UI.createTextButton(
57 Common.UIString('Refresh database'), () => this._refreshDatabaseButtonCl icked(),
58 Common.UIString('Refresh database'));
59 footer.appendChild(this._refreshButton);
60
56 this.update(database); 61 this.update(database);
57 } 62 }
58 63
59 _refreshDatabase() { 64 _refreshDatabase() {
60 this._securityOriginElement.textContent = this._database.databaseId.security Origin; 65 this._securityOriginElement.textContent = this._database.databaseId.security Origin;
61 this._versionElement.textContent = this._database.version; 66 this._versionElement.textContent = this._database.version;
62 } 67 }
63 68
69 _refreshDatabaseButtonClicked() {
70 this._model.refreshDatabase(this._database.databaseId);
71 }
72
64 /** 73 /**
65 * @param {!Resources.IndexedDBModel.Database} database 74 * @param {!Resources.IndexedDBModel.Database} database
66 */ 75 */
67 update(database) { 76 update(database) {
68 this._database = database; 77 this._database = database;
69 this._refreshDatabase(); 78 this._refreshDatabase();
79 this._updatedForTests();
80 }
81
82 _updatedForTests() {
83 // Sniffed in tests.
70 } 84 }
71 85
72 _deleteDatabase() { 86 _deleteDatabase() {
73 UI.ConfirmDialog.show( 87 UI.ConfirmDialog.show(
74 this.element, Common.UIString('Are you sure you want to delete "%s"?', t his._database.databaseId.name), 88 this.element, Common.UIString('Are you sure you want to delete "%s"?', t his._database.databaseId.name),
75 () => this._model.deleteDatabase(this._database.databaseId)); 89 () => this._model.deleteDatabase(this._database.databaseId));
76 } 90 }
77 }; 91 };
78 92
79 /** 93 /**
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 data['key'] = entries[i].key; 295 data['key'] = entries[i].key;
282 data['primaryKey'] = entries[i].primaryKey; 296 data['primaryKey'] = entries[i].primaryKey;
283 data['value'] = entries[i].value; 297 data['value'] = entries[i].value;
284 298
285 var node = new Resources.IDBDataGridNode(data); 299 var node = new Resources.IDBDataGridNode(data);
286 this._dataGrid.rootNode().appendChild(node); 300 this._dataGrid.rootNode().appendChild(node);
287 } 301 }
288 302
289 this._pageBackButton.setEnabled(!!skipCount); 303 this._pageBackButton.setEnabled(!!skipCount);
290 this._pageForwardButton.setEnabled(hasMore); 304 this._pageForwardButton.setEnabled(hasMore);
305 this._updatedDataForTests();
291 } 306 }
292 307
293 var idbKeyRange = key ? window.IDBKeyRange.lowerBound(key) : null; 308 var idbKeyRange = key ? window.IDBKeyRange.lowerBound(key) : null;
294 if (this._isIndex) { 309 if (this._isIndex) {
295 this._model.loadIndexData( 310 this._model.loadIndexData(
296 this._databaseId, this._objectStore.name, this._index.name, idbKeyRang e, skipCount, pageSize, 311 this._databaseId, this._objectStore.name, this._index.name, idbKeyRang e, skipCount, pageSize,
297 callback.bind(this)); 312 callback.bind(this));
298 } else { 313 } else {
299 this._model.loadObjectStoreData( 314 this._model.loadObjectStoreData(
300 this._databaseId, this._objectStore.name, idbKeyRange, skipCount, page Size, callback.bind(this)); 315 this._databaseId, this._objectStore.name, idbKeyRange, skipCount, page Size, callback.bind(this));
301 } 316 }
302 } 317 }
303 318
319 _updatedDataForTests() {
320 // Sniffed in tests.
321 }
322
304 /** 323 /**
305 * @param {!Common.Event} event 324 * @param {!Common.Event} event
306 */ 325 */
307 _refreshButtonClicked(event) { 326 _refreshButtonClicked(event) {
308 this._updateData(true); 327 this._updateData(true);
309 } 328 }
310 329
311 /** 330 /**
312 * @param {!Common.Event} event 331 * @param {!Common.Event} event
313 */ 332 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 cell.removeChildren(); 383 cell.removeChildren();
365 var objectElement = ObjectUI.ObjectPropertiesSection.defaultObjectPresen tation(value, undefined, true); 384 var objectElement = ObjectUI.ObjectPropertiesSection.defaultObjectPresen tation(value, undefined, true);
366 cell.appendChild(objectElement); 385 cell.appendChild(objectElement);
367 break; 386 break;
368 default: 387 default:
369 } 388 }
370 389
371 return cell; 390 return cell;
372 } 391 }
373 }; 392 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698