Changeset 183580 in webkit


Ignore:
Timestamp:
Apr 29, 2015 3:00:06 PM (9 years ago)
Author:
timothy@apple.com
Message:

Web Inspector: Split Storage from Resources tab
https://bugs.webkit.org/show_bug.cgi?id=144404

Reviewed by Joseph Pecoraro.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Base/Main.js:

(WebInspector.loaded):
(WebInspector.isTabTypeAllowed):
(WebInspector._tabContentViewForType):
(WebInspector._updateNewTabButtonState):
(WebInspector.showStorageTab):
(WebInspector._storageWasInspected):

  • UserInterface/Controllers/ApplicationCacheManager.js:

(WebInspector.ApplicationCacheManager.prototype.initialize):
(WebInspector.ApplicationCacheManager.prototype.get applicationCacheObjects):

  • UserInterface/Controllers/StorageManager.js:

(WebInspector.StorageManager.prototype.get domStorageObjects):
(WebInspector.StorageManager.prototype.get databases):
(WebInspector.StorageManager.prototype.get indexedDatabases):
(WebInspector.StorageManager.prototype.get cookieStorageObjects):

  • UserInterface/Images/Storage.svg: Added.
  • UserInterface/Main.html:
  • UserInterface/Views/DatabaseTableContentView.js:

(WebInspector.DatabaseTableContentView.prototype._queryFinished): Clear _dataGrid,
since it might have been allocated but still be empty. This avoids an exception in
updateLayout next time layout is updated.

  • UserInterface/Views/NewTabContentView.js:

(WebInspector.NewTabContentView):

  • UserInterface/Views/ResourceSidebarPanel.js:

(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):
(WebInspector.ResourceSidebarPanel.prototype._domStorageObjectWasAdded): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._domStorageObjectWasInspected): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._databaseWasAdded): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._databaseWasInspected): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._indexedDatabaseWasAdded): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._cookieStorageObjectWasAdded): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._frameManifestAdded): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._frameManifestRemoved): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._addStorageChild): Deleted.
(WebInspector.ResourceSidebarPanel.prototype._storageCleared): Deleted.

  • UserInterface/Views/ResourcesTabContentView.js:

(WebInspector.ResourcesTabContentView):
(WebInspector.ResourcesTabContentView.prototype.canShowRepresentedObject):

  • UserInterface/Views/StorageSidebarPanel.js: Added.

(WebInspector.StorageSidebarPanel):
(WebInspector.StorageSidebarPanel.prototype.showDefaultContentView):
(WebInspector.StorageSidebarPanel.prototype.closed):
(WebInspector.StorageSidebarPanel.prototype._treeElementSelected):
(WebInspector.StorageSidebarPanel.prototype._domStorageObjectWasAdded):
(WebInspector.StorageSidebarPanel.prototype._addDOMStorageObject):
(WebInspector.StorageSidebarPanel.prototype._domStorageObjectWasInspected):
(WebInspector.StorageSidebarPanel.prototype._databaseWasAdded):
(WebInspector.StorageSidebarPanel.prototype._addDatabase):
(WebInspector.StorageSidebarPanel.prototype._databaseWasInspected):
(WebInspector.StorageSidebarPanel.prototype._indexedDatabaseWasAdded):
(WebInspector.StorageSidebarPanel.prototype._addIndexedDatabase):
(WebInspector.StorageSidebarPanel.prototype._cookieStorageObjectWasAdded):
(WebInspector.StorageSidebarPanel.prototype._addCookieStorageObject):
(WebInspector.StorageSidebarPanel.prototype._frameManifestAdded):
(WebInspector.StorageSidebarPanel.prototype._addFrameManifest):
(WebInspector.StorageSidebarPanel.prototype._frameManifestRemoved):
(WebInspector.StorageSidebarPanel.prototype._compareTreeElements):
(WebInspector.StorageSidebarPanel.prototype._addStorageChild):
(WebInspector.StorageSidebarPanel.prototype._storageCleared):

  • UserInterface/Views/StorageTabContentView.js: Copied from Source/WebInspectorUI/UserInterface/Views/ResourcesTabContentView.js.

(WebInspector.StorageTabContentView):
(WebInspector.StorageTabContentView.prototype.get type):
(WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):

Location:
trunk/Source/WebInspectorUI
Files:
2 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r183579 r183580  
     12015-04-29  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: Split Storage from Resources tab
     4        https://bugs.webkit.org/show_bug.cgi?id=144404
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * Localizations/en.lproj/localizedStrings.js:
     9        * UserInterface/Base/Main.js:
     10        (WebInspector.loaded):
     11        (WebInspector.isTabTypeAllowed):
     12        (WebInspector._tabContentViewForType):
     13        (WebInspector._updateNewTabButtonState):
     14        (WebInspector.showStorageTab):
     15        (WebInspector._storageWasInspected):
     16        * UserInterface/Controllers/ApplicationCacheManager.js:
     17        (WebInspector.ApplicationCacheManager.prototype.initialize):
     18        (WebInspector.ApplicationCacheManager.prototype.get applicationCacheObjects):
     19        * UserInterface/Controllers/StorageManager.js:
     20        (WebInspector.StorageManager.prototype.get domStorageObjects):
     21        (WebInspector.StorageManager.prototype.get databases):
     22        (WebInspector.StorageManager.prototype.get indexedDatabases):
     23        (WebInspector.StorageManager.prototype.get cookieStorageObjects):
     24        * UserInterface/Images/Storage.svg: Added.
     25        * UserInterface/Main.html:
     26        * UserInterface/Views/DatabaseTableContentView.js:
     27        (WebInspector.DatabaseTableContentView.prototype._queryFinished): Clear _dataGrid,
     28        since it might have been allocated but still be empty. This avoids an exception in
     29        updateLayout next time layout is updated.
     30        * UserInterface/Views/NewTabContentView.js:
     31        (WebInspector.NewTabContentView):
     32        * UserInterface/Views/ResourceSidebarPanel.js:
     33        (WebInspector.ResourceSidebarPanel):
     34        (WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):
     35        (WebInspector.ResourceSidebarPanel.prototype._domStorageObjectWasAdded): Deleted.
     36        (WebInspector.ResourceSidebarPanel.prototype._domStorageObjectWasInspected): Deleted.
     37        (WebInspector.ResourceSidebarPanel.prototype._databaseWasAdded): Deleted.
     38        (WebInspector.ResourceSidebarPanel.prototype._databaseWasInspected): Deleted.
     39        (WebInspector.ResourceSidebarPanel.prototype._indexedDatabaseWasAdded): Deleted.
     40        (WebInspector.ResourceSidebarPanel.prototype._cookieStorageObjectWasAdded): Deleted.
     41        (WebInspector.ResourceSidebarPanel.prototype._frameManifestAdded): Deleted.
     42        (WebInspector.ResourceSidebarPanel.prototype._frameManifestRemoved): Deleted.
     43        (WebInspector.ResourceSidebarPanel.prototype._addStorageChild): Deleted.
     44        (WebInspector.ResourceSidebarPanel.prototype._storageCleared): Deleted.
     45        * UserInterface/Views/ResourcesTabContentView.js:
     46        (WebInspector.ResourcesTabContentView):
     47        (WebInspector.ResourcesTabContentView.prototype.canShowRepresentedObject):
     48        * UserInterface/Views/StorageSidebarPanel.js: Added.
     49        (WebInspector.StorageSidebarPanel):
     50        (WebInspector.StorageSidebarPanel.prototype.showDefaultContentView):
     51        (WebInspector.StorageSidebarPanel.prototype.closed):
     52        (WebInspector.StorageSidebarPanel.prototype._treeElementSelected):
     53        (WebInspector.StorageSidebarPanel.prototype._domStorageObjectWasAdded):
     54        (WebInspector.StorageSidebarPanel.prototype._addDOMStorageObject):
     55        (WebInspector.StorageSidebarPanel.prototype._domStorageObjectWasInspected):
     56        (WebInspector.StorageSidebarPanel.prototype._databaseWasAdded):
     57        (WebInspector.StorageSidebarPanel.prototype._addDatabase):
     58        (WebInspector.StorageSidebarPanel.prototype._databaseWasInspected):
     59        (WebInspector.StorageSidebarPanel.prototype._indexedDatabaseWasAdded):
     60        (WebInspector.StorageSidebarPanel.prototype._addIndexedDatabase):
     61        (WebInspector.StorageSidebarPanel.prototype._cookieStorageObjectWasAdded):
     62        (WebInspector.StorageSidebarPanel.prototype._addCookieStorageObject):
     63        (WebInspector.StorageSidebarPanel.prototype._frameManifestAdded):
     64        (WebInspector.StorageSidebarPanel.prototype._addFrameManifest):
     65        (WebInspector.StorageSidebarPanel.prototype._frameManifestRemoved):
     66        (WebInspector.StorageSidebarPanel.prototype._compareTreeElements):
     67        (WebInspector.StorageSidebarPanel.prototype._addStorageChild):
     68        (WebInspector.StorageSidebarPanel.prototype._storageCleared):
     69        * UserInterface/Views/StorageTabContentView.js: Copied from Source/WebInspectorUI/UserInterface/Views/ResourcesTabContentView.js.
     70        (WebInspector.StorageTabContentView):
     71        (WebInspector.StorageTabContentView.prototype.get type):
     72        (WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):
     73
    1742015-04-29  Timothy Hatcher  <timothy@apple.com>
    275
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r183468 r183580  
    225225localizedStrings["Filter Resource List"] = "Filter Resource List";
    226226localizedStrings["Filter Search Results"] = "Filter Search Results";
     227localizedStrings["Filter Storage List"] = "Filter Storage List";
    227228localizedStrings["Flows"] = "Flows";
    228229localizedStrings["Focused"] = "Focused";
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r183579 r183580  
    141141    this._splitConsoleHeightSetting = new WebInspector.Setting("split-console-height", 150);
    142142
    143     this._openTabsSetting = new WebInspector.Setting("open-tabs", ["elements", "resources", "timeline", "debugger", "console"]);
     143    this._openTabsSetting = new WebInspector.Setting("open-tabs", ["elements", "resources", "timeline", "debugger", "storage", "console"]);
    144144    this._selectedTabIndexSetting = new WebInspector.Setting("selected-tab-index", 0);
    145145
     
    377377    case WebInspector.ElementsTabContentView.Type:
    378378        return !!window.DOMAgent;
     379    case WebInspector.StorageTabContentView.Type:
     380        return !!window.DOMStorageAgent || !!window.DatabaseAgent || !!window.IndexedDBAgent;
    379381    case WebInspector.TimelineTabContentView.Type:
    380382        return !!window.TimelineAgent;
     
    387389{
    388390    switch (tabType) {
     391    case WebInspector.ConsoleTabContentView.Type:
     392        return new WebInspector.ConsoleTabContentView;
     393    case WebInspector.DebuggerTabContentView.Type:
     394        return new WebInspector.DebuggerTabContentView;
    389395    case WebInspector.ElementsTabContentView.Type:
    390396        return new WebInspector.ElementsTabContentView;
     397    case WebInspector.NewTabContentView.Type:
     398        return new WebInspector.NewTabContentView;
    391399    case WebInspector.ResourcesTabContentView.Type:
    392400        return new WebInspector.ResourcesTabContentView;
     401    case WebInspector.SearchTabContentView.Type:
     402        return new WebInspector.SearchTabContentView;
     403    case WebInspector.StorageTabContentView.Type:
     404        return new WebInspector.StorageTabContentView;
    393405    case WebInspector.TimelineTabContentView.Type:
    394406        return new WebInspector.TimelineTabContentView;
    395     case WebInspector.DebuggerTabContentView.Type:
    396         return new WebInspector.DebuggerTabContentView;
    397     case WebInspector.ConsoleTabContentView.Type:
    398         return new WebInspector.ConsoleTabContentView;
    399     case WebInspector.SearchTabContentView.Type:
    400         return new WebInspector.SearchTabContentView;
    401     case WebInspector.NewTabTabContentView.Type:
    402         return new WebInspector.NewTabTabContentView;
    403407    default:
    404408        console.error("Unknown tab type", tabType);
     
    427431WebInspector._updateNewTabButtonState = function(event)
    428432{
    429     var newTabAllowed = this.isNewTabWithTypeAllowed(WebInspector.ConsoleTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.ElementsTabContentView.Type);
     433    var newTabAllowed = this.isNewTabWithTypeAllowed(WebInspector.ConsoleTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.ElementsTabContentView.Type)
     434         || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type);
    430435    this.tabBar.newTabItem.disabled = !newTabAllowed;
    431436};
     
    754759};
    755760
     761WebInspector.showStorageTab = function()
     762{
     763    var tabContentView = this.tabBrowser.bestTabContentViewForClass(WebInspector.StorageTabContentView);
     764    if (!tabContentView)
     765        tabContentView = new WebInspector.StorageTabContentView;
     766    this.tabBrowser.showTabForContentView(tabContentView);
     767};
     768
    756769WebInspector.showTimelineTab = function()
    757770{
     
    14411454WebInspector._storageWasInspected = function(event)
    14421455{
    1443     // FIXME: This should show a Storage tab when we have one.
    1444     this.showResourcesTab();
     1456    this.showStorageTab();
    14451457};
    14461458
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js

    r181844 r183580  
    4545    initialize()
    4646    {
    47         this._applicationCacheObjects = [];
     47        this._applicationCacheObjects = {};
    4848
    4949        if (window.ApplicationCacheAgent)
    5050            ApplicationCacheAgent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));
     51    }
     52
     53    get applicationCacheObjects()
     54    {
     55        var applicationCacheObjects = [];
     56        for (var id in this._applicationCacheObjects)
     57            applicationCacheObjects.push(this._applicationCacheObjects[id]);
     58        return applicationCacheObjects;
    5159    }
    5260
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js

    r182113 r183580  
    6161    }
    6262
     63    get domStorageObjects()
     64    {
     65        return this._domStorageObjects;
     66    }
     67
     68    get databases()
     69    {
     70        return this._databaseObjects;
     71    }
     72
     73    get indexedDatabases()
     74    {
     75        return this._indexedDatabases;
     76    }
     77
     78    get cookieStorageObjects()
     79    {
     80        var cookieStorageObjects = [];
     81        for (var host in this._cookieStorageObjects)
     82            cookieStorageObjects.push(this._cookieStorageObjects[host]);
     83        return cookieStorageObjects;
     84    }
     85
    6386    domStorageWasAdded(id, host, isLocalStorage)
    6487    {
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r183469 r183580  
    354354    <script src="Views/SearchTabContentView.js"></script>
    355355    <script src="Views/SettingsTabContentView.js"></script>
     356    <script src="Views/StorageTabContentView.js"></script>
    356357    <script src="Views/TimelineTabContentView.js"></script>
    357358
     
    505506    <script src="Views/SourceCodeTimelineTreeElement.js"></script>
    506507    <script src="Views/SourceMapResourceTreeElement.js"></script>
     508    <script src="Views/StorageSidebarPanel.js"></script>
    507509    <script src="Views/SyntaxHighlightingSupport.js"></script>
    508510    <script src="Views/TextContentView.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js

    r183579 r183580  
    9191        this._dataGrid = new WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
    9292        if (!this._dataGrid || !this._dataGrid.element) {
     93            this._dataGrid = undefined;
     94
    9395            // If the DataGrid is empty, then we were returned a table with no columns. This can happen when a table has
    9496            // no data, the SELECT query only returns column names when there is data.
  • trunk/Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js

    r183468 r183580  
    3232    var allowedNewTabs = [
    3333        {image: "Images/Elements.svg", title: WebInspector.UIString("Elements"), type: WebInspector.ElementsTabContentView.Type},
     34        {image: "Images/Storage.svg", title: WebInspector.UIString("Storage"), type: WebInspector.StorageTabContentView.Type},
    3435        {image: "Images/Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}
    3536    ];
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js

    r183375 r183580  
    3636        this._waitingForInitialMainFrame = true;
    3737
    38         this._localStorageRootTreeElement = null;
    39         this._sessionStorageRootTreeElement = null;
    40 
    41         this._databaseRootTreeElement = null;
    42         this._databaseHostTreeElementMap = {};
    43 
    44         this._indexedDatabaseRootTreeElement = null;
    45         this._indexedDatabaseHostTreeElementMap = {};
    46 
    47         this._cookieStorageRootTreeElement = null;
    48 
    49         this._applicationCacheRootTreeElement = null;
    50         this._applicationCacheURLTreeElementMap = {};
    51 
    52         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, this._cookieStorageObjectWasAdded, this);
    53         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, this._domStorageObjectWasAdded, this);
    54         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasInspected, this._domStorageObjectWasInspected, this);
    55         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasAdded, this._databaseWasAdded, this);
    56         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasInspected, this._databaseWasInspected, this);
    57         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.IndexedDatabaseWasAdded, this._indexedDatabaseWasAdded, this);
    58         WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.Cleared, this._storageCleared, this);
    59 
    60         WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestAdded, this._frameManifestAdded, this);
    61         WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestRemoved, this._frameManifestRemoved, this);
    62 
    6338        WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
    6439
     
    301276    _treeElementSelected(treeElement, selectedByUser)
    302277    {
    303         if (treeElement instanceof WebInspector.FolderTreeElement || treeElement instanceof WebInspector.DatabaseHostTreeElement ||
    304             treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.IndexedDatabaseTreeElement)
    305             return;
    306 
    307         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement ||
    308             treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
    309             treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
    310             treeElement instanceof WebInspector.ContentFlowTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement ||
    311             treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
     278        if (treeElement instanceof WebInspector.FolderTreeElement)
     279            return;
     280
     281        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
    312282            WebInspector.showRepresentedObject(treeElement.representedObject);
    313283            return;
     
    315285
    316286        console.error("Unknown tree element", treeElement);
    317     }
    318 
    319     _domStorageObjectWasAdded(event)
    320     {
    321         var domStorage = event.data.domStorage;
    322         var storageElement = new WebInspector.DOMStorageTreeElement(domStorage);
    323 
    324         if (domStorage.isLocalStorage())
    325             this._localStorageRootTreeElement = this._addStorageChild(storageElement, this._localStorageRootTreeElement, WebInspector.UIString("Local Storage"));
    326         else
    327             this._sessionStorageRootTreeElement = this._addStorageChild(storageElement, this._sessionStorageRootTreeElement, WebInspector.UIString("Session Storage"));
    328     }
    329 
    330     _domStorageObjectWasInspected(event)
    331     {
    332         var domStorage = event.data.domStorage;
    333         var treeElement = this.treeElementForRepresentedObject(domStorage);
    334         treeElement.revealAndSelect(true);
    335     }
    336 
    337     _databaseWasAdded(event)
    338     {
    339         var database = event.data.database;
    340 
    341         console.assert(database instanceof WebInspector.DatabaseObject);
    342 
    343         if (!this._databaseHostTreeElementMap[database.host]) {
    344             this._databaseHostTreeElementMap[database.host] = new WebInspector.DatabaseHostTreeElement(database.host);
    345             this._databaseRootTreeElement = this._addStorageChild(this._databaseHostTreeElementMap[database.host], this._databaseRootTreeElement, WebInspector.UIString("Databases"));
    346         }
    347 
    348         var databaseElement = new WebInspector.DatabaseTreeElement(database);
    349         this._databaseHostTreeElementMap[database.host].appendChild(databaseElement);
    350     }
    351 
    352     _databaseWasInspected(event)
    353     {
    354         var database = event.data.database;
    355         var treeElement = this.treeElementForRepresentedObject(database);
    356         treeElement.revealAndSelect(true);
    357     }
    358 
    359     _indexedDatabaseWasAdded(event)
    360     {
    361         var indexedDatabase = event.data.indexedDatabase;
    362 
    363         console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
    364 
    365         if (!this._indexedDatabaseHostTreeElementMap[indexedDatabase.host]) {
    366             this._indexedDatabaseHostTreeElementMap[indexedDatabase.host] = new WebInspector.IndexedDatabaseHostTreeElement(indexedDatabase.host);
    367             this._indexedDatabaseRootTreeElement = this._addStorageChild(this._indexedDatabaseHostTreeElementMap[indexedDatabase.host], this._indexedDatabaseRootTreeElement, WebInspector.UIString("Indexed Databases"));
    368         }
    369 
    370         var indexedDatabaseElement = new WebInspector.IndexedDatabaseTreeElement(indexedDatabase);
    371         this._indexedDatabaseHostTreeElementMap[indexedDatabase.host].appendChild(indexedDatabaseElement);
    372     }
    373 
    374     _cookieStorageObjectWasAdded(event)
    375     {
    376         console.assert(event.data.cookieStorage instanceof WebInspector.CookieStorageObject);
    377 
    378         var cookieElement = new WebInspector.CookieStorageTreeElement(event.data.cookieStorage);
    379         this._cookieStorageRootTreeElement = this._addStorageChild(cookieElement, this._cookieStorageRootTreeElement, WebInspector.UIString("Cookies"));
    380     }
    381 
    382     _frameManifestAdded(event)
    383     {
    384         var frameManifest = event.data.frameManifest;
    385         console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
    386 
    387         var manifest = frameManifest.manifest;
    388         var manifestURL = manifest.manifestURL;
    389         if (!this._applicationCacheURLTreeElementMap[manifestURL]) {
    390             this._applicationCacheURLTreeElementMap[manifestURL] = new WebInspector.ApplicationCacheManifestTreeElement(manifest);
    391             this._applicationCacheRootTreeElement = this._addStorageChild(this._applicationCacheURLTreeElementMap[manifestURL], this._applicationCacheRootTreeElement, WebInspector.UIString("Application Cache"));
    392         }
    393 
    394         var frameCacheElement = new WebInspector.ApplicationCacheFrameTreeElement(frameManifest);
    395         this._applicationCacheURLTreeElementMap[manifestURL].appendChild(frameCacheElement);
    396     }
    397 
    398     _frameManifestRemoved(event)
    399     {
    400          // FIXME: Implement this.
    401287    }
    402288
     
    415301    }
    416302
    417     _addStorageChild(childElement, parentElement, folderName)
    418     {
    419         if (!parentElement) {
    420             childElement.flattened = true;
    421 
    422             this.contentTreeOutline.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, this.contentTreeOutline.children, this._compareTreeElements));
    423 
    424             return childElement;
    425         }
    426 
    427         if (parentElement instanceof WebInspector.StorageTreeElement) {
    428             console.assert(parentElement.flattened);
    429 
    430             var previousOnlyChild = parentElement;
    431             previousOnlyChild.flattened = false;
    432             this.contentTreeOutline.removeChild(previousOnlyChild);
    433 
    434             var folderElement = new WebInspector.FolderTreeElement(folderName);
    435             this.contentTreeOutline.insertChild(folderElement, insertionIndexForObjectInListSortedByFunction(folderElement, this.contentTreeOutline.children, this._compareTreeElements));
    436 
    437             folderElement.appendChild(previousOnlyChild);
    438             folderElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, folderElement.children, this._compareTreeElements));
    439 
    440             return folderElement;
    441         }
    442 
    443         console.assert(parentElement instanceof WebInspector.FolderTreeElement);
    444         parentElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, parentElement.children, this._compareTreeElements));
    445 
    446         return parentElement;
    447     }
    448 
    449     _storageCleared(event)
    450     {
    451         // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
    452         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
    453         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
    454         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
    455         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
    456         this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
    457 
    458         if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
    459             this._localStorageRootTreeElement.parent.removeChild(this._localStorageRootTreeElement);
    460 
    461         if (this._sessionStorageRootTreeElement && this._sessionStorageRootTreeElement.parent)
    462             this._sessionStorageRootTreeElement.parent.removeChild(this._sessionStorageRootTreeElement);
    463 
    464         if (this._databaseRootTreeElement && this._databaseRootTreeElement.parent)
    465             this._databaseRootTreeElement.parent.removeChild(this._databaseRootTreeElement);
    466 
    467         if (this._indexedDatabaseRootTreeElement && this._indexedDatabaseRootTreeElement.parent)
    468             this._indexedDatabaseRootTreeElement.parent.removeChild(this._indexedDatabaseRootTreeElement);
    469 
    470         if (this._cookieStorageRootTreeElement && this._cookieStorageRootTreeElement.parent)
    471             this._cookieStorageRootTreeElement.parent.removeChild(this._cookieStorageRootTreeElement);
    472 
    473         if (this._applicationCacheRootTreeElement && this._applicationCacheRootTreeElement.parent)
    474             this._applicationCacheRootTreeElement.parent.removeChild(this._applicationCacheRootTreeElement);
    475 
    476         this._localStorageRootTreeElement = null;
    477         this._sessionStorageRootTreeElement = null;
    478         this._databaseRootTreeElement = null;
    479         this._databaseHostTreeElementMap = {};
    480         this._indexedDatabaseRootTreeElement = null;
    481         this._indexedDatabaseHostTreeElementMap = {};
    482         this._cookieStorageRootTreeElement = null;
    483         this._applicationCacheRootTreeElement = null;
    484         this._applicationCacheURLTreeElementMap = {};
    485     }
    486 
    487303    _extraDomainsActivated()
    488304    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourcesTabContentView.js

    r183323 r183580  
    2727{
    2828    var tabBarItem = new WebInspector.TabBarItem("Images/Resources.svg", WebInspector.UIString("Resources"));
    29     var detailsSidebarPanels = [WebInspector.resourceDetailsSidebarPanel, WebInspector.applicationCacheDetailsSidebarPanel, WebInspector.probeDetailsSidebarPanel];
     29    var detailsSidebarPanels = [WebInspector.resourceDetailsSidebarPanel, WebInspector.probeDetailsSidebarPanel];
    3030
    3131    // FIXME: Until ContentFlows are moved to the Elements tab, these details sidebar panels need to be included.
     
    5353    canShowRepresentedObject: function(representedObject)
    5454    {
    55         return representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource ||
    56             representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.ContentFlow ||
    57             representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
    58             representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
    59             representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
    60             representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;
     55        return representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Script;
    6156    }
    6257};
  • trunk/Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js

    r183579 r183580  
    2424 */
    2525
    26 WebInspector.ResourcesTabContentView = function(identifier)
     26WebInspector.StorageTabContentView = function(identifier)
    2727{
    28     var tabBarItem = new WebInspector.TabBarItem("Images/Resources.svg", WebInspector.UIString("Resources"));
    29     var detailsSidebarPanels = [WebInspector.resourceDetailsSidebarPanel, WebInspector.applicationCacheDetailsSidebarPanel, WebInspector.probeDetailsSidebarPanel];
     28    var tabBarItem = new WebInspector.TabBarItem("Images/Storage.svg", WebInspector.UIString("Storage"));
     29    var detailsSidebarPanels = [WebInspector.applicationCacheDetailsSidebarPanel];
    3030
    31     // FIXME: Until ContentFlows are moved to the Elements tab, these details sidebar panels need to be included.
    32     detailsSidebarPanels = detailsSidebarPanels.concat([WebInspector.domNodeDetailsSidebarPanel, WebInspector.cssStyleDetailsSidebarPanel]);
    33     if (WebInspector.layerTreeDetailsSidebarPanel)
    34         detailsSidebarPanels.push(WebInspector.layerTreeDetailsSidebarPanel);
    35 
    36     // FIME: Until ResourceSidebarPanel supports instantiating after inspector launch, disable closing.
    37     tabBarItem.hideCloseButton = true;
    38 
    39     WebInspector.ContentBrowserTabContentView.call(this, identifier || "resources", "resources", tabBarItem, WebInspector.ResourceSidebarPanel, detailsSidebarPanels);
     31    WebInspector.ContentBrowserTabContentView.call(this, identifier || "storage", "storage", tabBarItem, WebInspector.StorageSidebarPanel, detailsSidebarPanels);
    4032};
    4133
    42 WebInspector.ResourcesTabContentView.prototype = {
    43     constructor: WebInspector.ResourcesTabContentView,
     34WebInspector.StorageTabContentView.prototype = {
     35    constructor: WebInspector.StorageTabContentView,
    4436    __proto__: WebInspector.ContentBrowserTabContentView.prototype,
    4537
     
    4840    get type()
    4941    {
    50         return WebInspector.ResourcesTabContentView.Type;
     42        return WebInspector.StorageTabContentView.Type;
    5143    },
    5244
    5345    canShowRepresentedObject: function(representedObject)
    5446    {
    55         return representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource ||
    56             representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.ContentFlow ||
    57             representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
     47        return representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
    5848            representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
    5949            representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
     
    6252};
    6353
    64 WebInspector.ResourcesTabContentView.Type = "resources";
     54WebInspector.StorageTabContentView.Type = "storage";
Note: See TracChangeset for help on using the changeset viewer.