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

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

Issue 2793203002: [DevTools] Pass sidebar and not the panel. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | 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) 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 * @unrestricted 604 * @unrestricted
605 */ 605 */
606 Resources.BaseStorageTreeElement = class extends UI.TreeElement { 606 Resources.BaseStorageTreeElement = class extends UI.TreeElement {
607 /** 607 /**
608 * @param {!Resources.ResourcesPanel} storagePanel 608 * @param {!Resources.ResourcesPanel} storagePanel
609 * @param {string} title 609 * @param {string} title
610 * @param {boolean} expandable 610 * @param {boolean} expandable
611 */ 611 */
612 constructor(storagePanel, title, expandable) { 612 constructor(storagePanel, title, expandable) {
613 super(title, expandable); 613 super(title, expandable);
614 console.assert(storagePanel);
dgozman 2017/04/04 16:48:30 It is marked as non-nullable. Don't assert.
eostroukhov 2017/04/04 17:31:37 Done.
614 this._storagePanel = storagePanel; 615 this._storagePanel = storagePanel;
615 } 616 }
616 617
617 /** 618 /**
618 * @override 619 * @override
619 * @return {boolean} 620 * @return {boolean}
620 */ 621 */
621 onselect(selectedByUser) { 622 onselect(selectedByUser) {
622 if (!selectedByUser) 623 if (!selectedByUser)
623 return false; 624 return false;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 _updateChildren() { 730 _updateChildren() {
730 this.removeChildren(); 731 this.removeChildren();
731 732
732 /** 733 /**
733 * @param {!Array.<string>} tableNames 734 * @param {!Array.<string>} tableNames
734 * @this {Resources.DatabaseTreeElement} 735 * @this {Resources.DatabaseTreeElement}
735 */ 736 */
736 function tableNamesCallback(tableNames) { 737 function tableNamesCallback(tableNames) {
737 var tableNamesLength = tableNames.length; 738 var tableNamesLength = tableNames.length;
738 for (var i = 0; i < tableNamesLength; ++i) 739 for (var i = 0; i < tableNamesLength; ++i)
739 this.appendChild(new Resources.DatabaseTableTreeElement(this._storagePan el, this._database, tableNames[i])); 740 this.appendChild(new Resources.DatabaseTableTreeElement(this._sidebar, t his._database, tableNames[i]));
740 } 741 }
741 this._database.getTableNames(tableNamesCallback.bind(this)); 742 this._database.getTableNames(tableNamesCallback.bind(this));
742 } 743 }
743 }; 744 };
744 745
745 /** 746 /**
746 * @unrestricted 747 * @unrestricted
747 */ 748 */
748 Resources.DatabaseTableTreeElement = class extends Resources.BaseStorageTreeElem ent { 749 Resources.DatabaseTableTreeElement = class extends Resources.BaseStorageTreeElem ent {
750 /**
751 * @param {!Resources.ApplicationPanelSidebar} sidebar
752 * @param {!Resources.Database} database
753 * @param {string} tableName
754 */
749 constructor(sidebar, database, tableName) { 755 constructor(sidebar, database, tableName) {
750 super(sidebar._panel, tableName, false); 756 super(sidebar._panel, tableName, false);
751 this._sidebar = sidebar; 757 this._sidebar = sidebar;
752 this._database = database; 758 this._database = database;
753 this._tableName = tableName; 759 this._tableName = tableName;
754 var icon = UI.Icon.create('mediumicon-table', 'resource-tree-item'); 760 var icon = UI.Icon.create('mediumicon-table', 'resource-tree-item');
755 this.setLeadingIcons([icon]); 761 this.setLeadingIcons([icon]);
756 } 762 }
757 763
758 get itemURL() { 764 get itemURL() {
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 1648
1643 this.element.classList.add('storage-view'); 1649 this.element.classList.add('storage-view');
1644 this._emptyWidget = new UI.EmptyWidget(''); 1650 this._emptyWidget = new UI.EmptyWidget('');
1645 this._emptyWidget.show(this.element); 1651 this._emptyWidget.show(this.element);
1646 } 1652 }
1647 1653
1648 setText(text) { 1654 setText(text) {
1649 this._emptyWidget.text = text; 1655 this._emptyWidget.text = text;
1650 } 1656 }
1651 }; 1657 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698