2011-06-23 Vsevolod Vlasov <vsevik@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 15:56:07 +0000 (15:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 15:56:07 +0000 (15:56 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: Show "no content" message in network panel when resource does not have content available.
        https://bugs.webkit.org/show_bug.cgi?id=63007

        * English.lproj/localizedStrings.js:
        * WebCore.gypi:
        * WebCore.vcproj/WebCore.vcproj:
        * inspector/front-end/ApplicationCacheItemsView.js:
        (WebInspector.ApplicationCacheItemsView):
        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
        * inspector/front-end/CookieItemsView.js:
        (WebInspector.CookieItemsView):
        (WebInspector.CookieItemsView.prototype._updateWithCookies):
        * inspector/front-end/DatabaseTableView.js:
        (WebInspector.DatabaseTableView.prototype._queryFinished):
        * inspector/front-end/EmptyView.js: Added.
        (WebInspector.EmptyView):
        (WebInspector.EmptyView.prototype.show):
        (WebInspector.EmptyView.prototype.set text):
        * inspector/front-end/NetworkItemView.js:
        (WebInspector.NetworkItemView):
        (WebInspector.ResourceContentView):
        (WebInspector.ResourceContentView.prototype.hasContent):
        (WebInspector.ResourceContentView.prototype.get sourceView):
        (WebInspector.ResourceContentView.prototype.show):
        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown.callback):
        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown):
        (WebInspector.ResourceContentView.prototype.contentLoaded):
        * inspector/front-end/ResourceCookiesView.js:
        (WebInspector.ResourceCookiesView.prototype.show):
        * inspector/front-end/ResourcePreviewView.js:
        (WebInspector.ResourcePreviewView):
        (WebInspector.ResourcePreviewView.prototype.contentLoaded):
        (WebInspector.ResourcePreviewView.prototype._createInnerView):
        * inspector/front-end/ResourceResponseView.js: Added.
        (WebInspector.ResourceResponseView):
        (WebInspector.ResourceResponseView.prototype.get sourceView):
        (WebInspector.ResourceResponseView.prototype.contentLoaded):
        * inspector/front-end/ResourceTimingView.js:
        (WebInspector.ResourceTimingView.prototype.show):
        * inspector/front-end/ResourcesPanel.js:
        (WebInspector.StorageCategoryView):
        (WebInspector.StorageCategoryView.prototype.setText):
        * inspector/front-end/WebKit.qrc:
        * inspector/front-end/inspector.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89577 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
Source/WebCore/inspector/front-end/CookieItemsView.js
Source/WebCore/inspector/front-end/DatabaseTableView.js
Source/WebCore/inspector/front-end/EmptyView.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/NetworkItemView.js
Source/WebCore/inspector/front-end/ResourceCookiesView.js
Source/WebCore/inspector/front-end/ResourcePreviewView.js
Source/WebCore/inspector/front-end/ResourceResponseView.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/ResourceTimingView.js
Source/WebCore/inspector/front-end/ResourcesPanel.js
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/inspector.html

index 949474a..fe1ca71 100644 (file)
@@ -1,3 +1,52 @@
+2011-06-23  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Show "no content" message in network panel when resource does not have content available.
+        https://bugs.webkit.org/show_bug.cgi?id=63007
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        (WebInspector.ApplicationCacheItemsView):
+        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
+        * inspector/front-end/CookieItemsView.js:
+        (WebInspector.CookieItemsView):
+        (WebInspector.CookieItemsView.prototype._updateWithCookies):
+        * inspector/front-end/DatabaseTableView.js:
+        (WebInspector.DatabaseTableView.prototype._queryFinished):
+        * inspector/front-end/EmptyView.js: Added.
+        (WebInspector.EmptyView):
+        (WebInspector.EmptyView.prototype.show):
+        (WebInspector.EmptyView.prototype.set text):
+        * inspector/front-end/NetworkItemView.js:
+        (WebInspector.NetworkItemView):
+        (WebInspector.ResourceContentView):
+        (WebInspector.ResourceContentView.prototype.hasContent):
+        (WebInspector.ResourceContentView.prototype.get sourceView):
+        (WebInspector.ResourceContentView.prototype.show):
+        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown.callback):
+        (WebInspector.ResourceContentView.prototype._ensureInnerViewShown):
+        (WebInspector.ResourceContentView.prototype.contentLoaded):
+        * inspector/front-end/ResourceCookiesView.js:
+        (WebInspector.ResourceCookiesView.prototype.show):
+        * inspector/front-end/ResourcePreviewView.js:
+        (WebInspector.ResourcePreviewView):
+        (WebInspector.ResourcePreviewView.prototype.contentLoaded):
+        (WebInspector.ResourcePreviewView.prototype._createInnerView):
+        * inspector/front-end/ResourceResponseView.js: Added.
+        (WebInspector.ResourceResponseView):
+        (WebInspector.ResourceResponseView.prototype.get sourceView):
+        (WebInspector.ResourceResponseView.prototype.contentLoaded):
+        * inspector/front-end/ResourceTimingView.js:
+        (WebInspector.ResourceTimingView.prototype.show):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.StorageCategoryView):
+        (WebInspector.StorageCategoryView.prototype.setText):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+
 2011-06-23  Balazs Kelemen  <kbalazs@webkit.org>
 
         Reviewed by Adam Roben.
index 0d13632..2fb0d8e 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index eef8fd3..97775b9 100644 (file)
             'inspector/front-end/Drawer.js',
             'inspector/front-end/ElementsPanel.js',
             'inspector/front-end/ElementsTreeOutline.js',
+            'inspector/front-end/EmptyView.js',
             'inspector/front-end/EventListenersSidebarPane.js',
             'inspector/front-end/ExtensionAPI.js',
             'inspector/front-end/ExtensionAuditCategory.js',
             'inspector/front-end/ResourceHeadersView.js',
             'inspector/front-end/ResourceJSONView.js',
             'inspector/front-end/ResourceHTMLView.js',
+            'inspector/front-end/ResourceResponseView.js',
             'inspector/front-end/ResourceTimingView.js',
             'inspector/front-end/ResourceTreeModel.js',
             'inspector/front-end/ResourceView.js',
index a86ed67..342ae6c 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\inspector\front-end\EmptyView.js"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\inspector\front-end\EventListenersSidebarPane.js"
                                        >
                                </File>
                                        >
                                </File>
                                <File
+                                       RelativePath="..\inspector\front-end\ResourceResponseView.js"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\inspector\front-end\ResourceTimingView.js"
                                        >
                                </File>
index 6e017c0..9d1b6a4 100644 (file)
@@ -61,10 +61,8 @@ WebInspector.ApplicationCacheItemsView = function(treeElement, appcacheDomain)
     this._treeElement = treeElement;
     this._appcacheDomain = appcacheDomain;
 
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this._emptyMsgElement.textContent = WebInspector.UIString("No Application Cache information available.");
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("No Application Cache information available."));
+    this._emptyView.show(this.element);
 
     this.updateStatus(applicationCache.UNCACHED);
 
@@ -164,7 +162,7 @@ WebInspector.ApplicationCacheItemsView.prototype = {
         var lastPathComponent = applicationCaches.lastPathComponent;
 
         if (!this._manifest) {
-            this._emptyMsgElement.removeStyleClass("hidden");
+            this._emptyView.show(this.element);
             this.deleteButton.visible = false;
             if (this._dataGrid)
                 this._dataGrid.element.addStyleClass("hidden");
@@ -177,7 +175,7 @@ WebInspector.ApplicationCacheItemsView.prototype = {
         this._populateDataGrid();
         this._dataGrid.autoSizeColumns(20, 80);
         this._dataGrid.element.removeStyleClass("hidden");
-        this._emptyMsgElement.addStyleClass("hidden");
+        this._emptyView.hide();
         this.deleteButton.visible = true;
 
         var totalSizeString = Number.bytesToString(this._size);
index 6bf3326..d6e62dd 100644 (file)
@@ -43,10 +43,8 @@ WebInspector.CookieItemsView = function(treeElement, cookieDomain)
     this._treeElement = treeElement;
     this._cookieDomain = cookieDomain;
 
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this._emptyMsgElement.textContent = WebInspector.UIString("This site has no cookies.");
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This site has no cookies."));
+    this._emptyView.show(this.element);
 }
 
 WebInspector.CookieItemsView.prototype = {
@@ -84,7 +82,7 @@ WebInspector.CookieItemsView.prototype = {
 
         if (!this._cookies.length) {
             // Nothing to show.
-            this._emptyMsgElement.removeStyleClass("hidden");
+            this._emptyView.show(this.element);
             this._deleteButton.visible = false;
             if (this._cookiesTable)
                 this._cookiesTable.element.addStyleClass("hidden");
@@ -98,7 +96,7 @@ WebInspector.CookieItemsView.prototype = {
 
         this._cookiesTable.setCookies(this._cookies);
         this._cookiesTable.element.removeStyleClass("hidden");
-        this._emptyMsgElement.addStyleClass("hidden");
+        this._emptyView.hide();
         if (isAdvanced) {
             this._treeElement.subtitle = String.sprintf(WebInspector.UIString("%d cookies (%s)"), this._cookies.length,
                 Number.bytesToString(this._totalSize));
index 1a886ff..843c11a 100644 (file)
@@ -60,10 +60,8 @@ WebInspector.DatabaseTableView.prototype = {
 
         var dataGrid = WebInspector.panels.resources.dataGridForResult(columnNames, values);
         if (!dataGrid) {
-            var emptyMsgElement = document.createElement("div");
-            emptyMsgElement.className = "storage-empty-view";
-            emptyMsgElement.textContent = WebInspector.UIString("The ā€œ%sā€\ntable is empty.", this.tableName);
-            this.element.appendChild(emptyMsgElement);
+            this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("The ā€œ%sā€\ntable is empty.", this.tableName));
+            this._emptyView.show(this.element);
             return;
         }
 
diff --git a/Source/WebCore/inspector/front-end/EmptyView.js b/Source/WebCore/inspector/front-end/EmptyView.js
new file mode 100644 (file)
index 0000000..441ddc4
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.EmptyView = function(text)
+{
+    WebInspector.View.call(this);
+    this._text = text;
+}
+
+WebInspector.EmptyView.prototype = {
+    show: function(parentElement)
+    {
+        WebInspector.View.prototype.show.call(this, parentElement);
+
+        this.element.className = "storage-empty-view";
+        this.element.textContent = this._text;
+    },
+    
+    set text(text)
+    {
+        this._text = text;
+        if (this.visible)
+            this.element.textContent = this._text;
+    },
+}
+
+WebInspector.EmptyView.prototype.__proto__ = WebInspector.View.prototype;
index c29dfea..880cf60 100644 (file)
@@ -38,7 +38,7 @@ WebInspector.NetworkItemView = function(resource)
     var headersView = new WebInspector.ResourceHeadersView(resource);
     this._tabbedPane.appendTab("headers", WebInspector.UIString("Headers"), headersView);
 
-    var responseView = new WebInspector.ResourceSourceFrame(resource);
+    var responseView = new WebInspector.ResourceResponseView(resource);
     var previewView = new WebInspector.ResourcePreviewView(resource, responseView);
 
     this._tabbedPane.appendTab("preview", WebInspector.UIString("Preview"), previewView);
@@ -99,3 +99,50 @@ WebInspector.NetworkItemView.prototype = {
 }
 
 WebInspector.NetworkItemView.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.ResourceContentView = function(resource)
+{
+    WebInspector.ResourceView.call(this, resource);
+}
+
+WebInspector.ResourceContentView.prototype = {
+    hasContent: function()
+    {
+        return true;
+    },
+
+    get sourceView()
+    {
+        if (!this._sourceView && WebInspector.ResourceView.hasTextContent(this.resource))
+            this._sourceView = new WebInspector.ResourceSourceFrame(this.resource);
+        return this._sourceView;
+    },
+
+    show: function(parentElement)
+    {
+        WebInspector.ResourceView.prototype.show.call(this, parentElement);
+        this._ensureInnerViewShown();
+    },
+
+    _ensureInnerViewShown: function()
+    {
+        if (this._innerViewShowRequested)
+            return;
+        this._innerViewShowRequested = true;
+
+        function callback()
+        {
+            this._innerViewShowRequested = false;
+            this.contentLoaded();
+        }
+
+        this.resource.requestContent(callback.bind(this));
+    },
+
+    contentLoaded: function()
+    {
+        // Should be implemented by subclasses.
+    }
+}
+
+WebInspector.ResourceContentView.prototype.__proto__ = WebInspector.ResourceView.prototype;
index c126a93..a50bea4 100644 (file)
@@ -43,11 +43,9 @@ WebInspector.ResourceCookiesView.prototype = {
     show: function(parentElement)
     {
         if (!this._gotCookies) {
-            if (!this._emptyMsgElement) {
-                this._emptyMsgElement = document.createElement("div");
-                this._emptyMsgElement.className = "storage-empty-view";
-                this._emptyMsgElement.textContent = WebInspector.UIString("This request has no cookies.");
-                this.element.appendChild(this._emptyMsgElement);
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no cookies."));
+                this._emptyView.show(this.element);
             }
             WebInspector.View.prototype.show.call(this, parentElement);
             return;
index a051909..e82cc68 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ResourcePreviewView = function(resource, sourceView)
+WebInspector.ResourcePreviewView = function(resource, responseView)
 {
-    WebInspector.ResourceView.call(this, resource);
-    this._sourceView = sourceView;
+    WebInspector.ResourceContentView.call(this, resource);
+    this._responseView = responseView;
 }
 
 WebInspector.ResourcePreviewView.prototype = {
-    hasContent: function()
+    contentLoaded: function()
     {
-        return true;
-    },
-
-    show: function(parentElement)
-    {
-        WebInspector.ResourceView.prototype.show.call(this, parentElement);
-        this._ensureInnerViewShown();
-    },
-
-    _ensureInnerViewShown: function()
-    {
-        if (this._innerViewShowRequested)
-            return;
-        this._innerViewShowRequested = true;
-
-        function callback()
-        {
-            this._createInnerView(callback).show(this.element);
-            this._innerViewShowRequested = false;
+        if (!this.resource.content) {
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no preview available."));
+                this._emptyView.show(this.element);
+            }
+        } else {
+            if (this._emptyView) {
+                this._emptyView.detach();
+                delete this._emptyView;
+            }
+            var view = this._createInnerView();
+            view.show(this.element);
         }
-
-        this.resource.requestContent(callback.bind(this));
     },
 
-    _createInnerView: function(callback)
+    _createInnerView: function()
     {
         if (this.resource.hasErrorStatusCode() && this.resource.content)
             return new WebInspector.ResourceHTMLView(this.resource);
@@ -72,13 +63,11 @@ WebInspector.ResourcePreviewView.prototype = {
                 return new WebInspector.ResourceJSONView(this.resource, parsedJSON);
         }
 
-        if (WebInspector.ResourceView.hasTextContent(this.resource))
-            return this._sourceView;
+        if (this._responseView.sourceView)
+            return this._responseView.sourceView;
 
         return WebInspector.ResourceView.nonSourceViewForResource(this.resource);
-    },
-    
-    
+    }
 }
 
-WebInspector.ResourcePreviewView.prototype.__proto__ = WebInspector.ResourceView.prototype;
+WebInspector.ResourcePreviewView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
diff --git a/Source/WebCore/inspector/front-end/ResourceResponseView.js b/Source/WebCore/inspector/front-end/ResourceResponseView.js
new file mode 100644 (file)
index 0000000..cfee8bd
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.ResourceResponseView = function(resource)
+{
+    WebInspector.ResourceContentView.call(this, resource);
+}
+
+WebInspector.ResourceResponseView.prototype = {
+    get sourceView()
+    {
+        if (!this._sourceView && WebInspector.ResourceView.hasTextContent(this.resource))
+            this._sourceView = new WebInspector.ResourceSourceFrame(this.resource);
+        return this._sourceView;
+    },
+
+    contentLoaded: function()
+    {
+        if (!this.resource.content || !this.sourceView) {
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no response data available."));
+                this._emptyView.show(this.element);
+            }
+        } else {
+            if (this._emptyView) {
+                this._emptyView.detach();
+                delete this._emptyView;
+            }
+            this.sourceView.show(this.element);
+        }
+    }
+}
+
+WebInspector.ResourceResponseView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
index 04f22f8..f85c583 100644 (file)
@@ -42,18 +42,18 @@ WebInspector.ResourceTimingView.prototype = {
     show: function(parentElement)
     {
         if (!this._resource.timing) {
-            if (!this._emptyMsgElement) {
-                this._emptyMsgElement = document.createElement("div");
-                this._emptyMsgElement.className = "storage-empty-view";
-                this._emptyMsgElement.textContent = WebInspector.UIString("This request has no detailed timing info.");
-                this.element.appendChild(this._emptyMsgElement);
+            if (!this._emptyView) {
+                this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no detailed timing info."));
+                this._emptyView.show(this.element);
             }
             WebInspector.View.prototype.show.call(this, parentElement);
             return;
         }
 
-        if (this._emptyMsgElement)
-            this._emptyMsgElement.parentElement.removeChild(this._emptyMsgElement);
+        if (this._emptyView) {
+            this._emptyView.detach();
+            delete this._emptyView;
+        }
 
         this._refresh();
         WebInspector.View.prototype.show.call(this, parentElement);
index 8adc9d9..9aa9274 100644 (file)
@@ -1611,17 +1611,15 @@ WebInspector.StorageCategoryView = function()
     WebInspector.View.call(this);
 
     this.element.addStyleClass("storage-view");
-
-    this._emptyMsgElement = document.createElement("div");
-    this._emptyMsgElement.className = "storage-empty-view";
-    this.element.appendChild(this._emptyMsgElement);
+    this._emptyView = new WebInspector.EmptyView();
+    this._emptyView.show(this.element);
 }
 
 WebInspector.StorageCategoryView.prototype = {
     setText: function(text)
     {
-        this._emptyMsgElement.textContent = text;
-    }
+        this._emptyView.text = text;    
+    }        
 }
 
 WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototype;
index 08ffe4d..fc7d252 100644 (file)
@@ -40,6 +40,7 @@
     <file>Drawer.js</file>
     <file>ElementsPanel.js</file>
     <file>ElementsTreeOutline.js</file>
+    <file>EmptyView.js</file>
     <file>EventListenersSidebarPane.js</file>
     <file>ExtensionAPI.js</file>
     <file>ExtensionAuditCategory.js</file>
@@ -85,6 +86,7 @@
     <file>ResourceJSONView.js</file>
     <file>ResourceHTMLView.js</file>
     <file>ResourceHeadersView.js</file>
+    <file>ResourceResponseView.js</file>
     <file>ResourceTimingView.js</file>
     <file>ResourceTreeModel.js</file>
     <file>ResourceView.js</file>
index 6505a8b..9f3e4cf 100644 (file)
@@ -120,13 +120,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="AuditRules.js"></script>
     <script type="text/javascript" src="AuditCategories.js"></script>
     <script type="text/javascript" src="AuditFormatters.js"></script>
+    <script type="text/javascript" src="NetworkItemView.js"></script>
+    <script type="text/javascript" src="EmptyView.js"></script>
     <script type="text/javascript" src="ResourceHeadersView.js"></script>
     <script type="text/javascript" src="ResourceCookiesView.js"></script>
     <script type="text/javascript" src="ResourceTimingView.js"></script>
     <script type="text/javascript" src="ResourceJSONView.js"></script>
     <script type="text/javascript" src="ResourceHTMLView.js"></script>
+    <script type="text/javascript" src="ResourceResponseView.js"></script>
     <script type="text/javascript" src="ResourcePreviewView.js"></script>
-    <script type="text/javascript" src="NetworkItemView.js"></script>
     <script type="text/javascript" src="ScriptFormatter.js"></script>
     <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
     <script type="text/javascript" src="TextEditorModel.js"></script>