Title: [100894] trunk/Source/WebCore
Revision
100894
Author
[email protected]
Date
2011-11-21 02:22:00 -0800 (Mon, 21 Nov 2011)

Log Message

Web Inspector: ApplicationCache view should show navigator.onLine indicator.
https://bugs.webkit.org/show_bug.cgi?id=72618

Reviewed by Pavel Feldman.

* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::enable):
* inspector/front-end/ApplicationCacheItemsView.js:
(WebInspector.ApplicationCacheItemsView):
(WebInspector.ApplicationCacheItemsView.prototype.wasShown):
* inspector/front-end/ApplicationCacheModel.js:
(WebInspector.ApplicationCacheModel):
(WebInspector.ApplicationCacheModel.prototype.get onLine):
(WebInspector.ApplicationCacheModel.prototype._networkStateUpdated):
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.showApplicationCache):
(WebInspector.ResourcesPanel.prototype._applicationCacheNetworkStateChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (100893 => 100894)


--- trunk/Source/WebCore/ChangeLog	2011-11-21 09:55:02 UTC (rev 100893)
+++ trunk/Source/WebCore/ChangeLog	2011-11-21 10:22:00 UTC (rev 100894)
@@ -1,3 +1,23 @@
+2011-11-21  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: ApplicationCache view should show navigator.onLine indicator.
+        https://bugs.webkit.org/show_bug.cgi?id=72618
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/InspectorApplicationCacheAgent.cpp:
+        (WebCore::InspectorApplicationCacheAgent::enable):
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        (WebInspector.ApplicationCacheItemsView):
+        (WebInspector.ApplicationCacheItemsView.prototype.wasShown):
+        * inspector/front-end/ApplicationCacheModel.js:
+        (WebInspector.ApplicationCacheModel):
+        (WebInspector.ApplicationCacheModel.prototype.get onLine):
+        (WebInspector.ApplicationCacheModel.prototype._networkStateUpdated):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.showApplicationCache):
+        (WebInspector.ResourcesPanel.prototype._applicationCacheNetworkStateChanged):
+
 2011-11-21  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix make distcheck build.

Modified: trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp (100893 => 100894)


--- trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp	2011-11-21 09:55:02 UTC (rev 100893)
+++ trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp	2011-11-21 10:22:00 UTC (rev 100894)
@@ -79,6 +79,9 @@
 {
     m_state->setBoolean(ApplicationCacheAgentState::applicationCacheAgentEnabled, true);
     m_instrumentingAgents->setInspectorApplicationCacheAgent(this);
+
+    // We need to pass initial navigator.onOnline.
+    networkStateChanged();
 }
 
 void InspectorApplicationCacheAgent::updateApplicationCacheStatus(Frame* frame)

Modified: trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js (100893 => 100894)


--- trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js	2011-11-21 09:55:02 UTC (rev 100893)
+++ trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js	2011-11-21 10:22:00 UTC (rev 100894)
@@ -27,7 +27,7 @@
  * @constructor
  * @extends {WebInspector.View}
  */
-WebInspector.ApplicationCacheItemsView = function(model, frameId, status)
+WebInspector.ApplicationCacheItemsView = function(model, frameId)
 {
     WebInspector.View.call(this);
     
@@ -64,15 +64,15 @@
     this._emptyView.show(this.element);
 
     this._markDirty();
+    
+    var status = this._model.frameManifestStatus(frameId);
     this.updateStatus(status);
+    
+    this.updateNetworkState(this._model.onLine);
 
     // FIXME: Status bar items don't work well enough yet, so they are being hidden.
     // http://webkit.org/b/41637 Web Inspector: Give Semantics to "Refresh" and "Delete" Buttons in ApplicationCache DataGrid
-    // http://webkit.org/b/72618 Web Inspector: ApplicationCache view should show navigator.onLine indicator.
     this.deleteButton.element.style.display = "none";
-    this.connectivityIcon.style.display = "none";
-    this.connectivityMessage.style.display = "none";
-    this.divider.style.display = "none";
 }
 
 WebInspector.ApplicationCacheItemsView.prototype = {
@@ -87,7 +87,6 @@
 
     wasShown: function()
     {
-        this.updateNetworkState(navigator.onLine);
         this._maybeUpdate();
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/ApplicationCacheModel.js (100893 => 100894)


--- trunk/Source/WebCore/inspector/front-end/ApplicationCacheModel.js	2011-11-21 09:55:02 UTC (rev 100893)
+++ trunk/Source/WebCore/inspector/front-end/ApplicationCacheModel.js	2011-11-21 10:22:00 UTC (rev 100894)
@@ -42,6 +42,8 @@
     this._manifestURLsByFrame = {};
 
     this._mainFrameNavigated();
+    
+    this._onLine = true;
 }
 
 WebInspector.ApplicationCacheModel.EventTypes = {
@@ -170,6 +172,14 @@
     },
     
     /**
+     * @return {number}
+     */
+    get onLine()
+    {
+        return this._onLine;
+    },
+    
+    /**
      * @param {string} frameId
      * @param {string} manifestURL
      * @param {number} status
@@ -204,6 +214,7 @@
      */
     _networkStateUpdated: function(isNowOnline)
     {
+        this._onLine = isNowOnline;
         this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.NetworkStateChanged, isNowOnline);
     }
 }

Modified: trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js (100893 => 100894)


--- trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2011-11-21 09:55:02 UTC (rev 100893)
+++ trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js	2011-11-21 10:22:00 UTC (rev 100894)
@@ -479,16 +479,9 @@
 
     showApplicationCache: function(frameId)
     {
-        var status = this._applicationCacheModel.frameManifestStatus(frameId)
+        if (!this._applicationCacheViews[frameId])
+            this._applicationCacheViews[frameId] = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, frameId);
 
-        if (!this._applicationCacheViews[frameId]) {
-            this._applicationCacheViews[frameId] = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, frameId, status);
-
-            // FIXME: Make sure this._cachedApplicationCacheNetworkState is always set and is always up to date.
-            if (typeof(this._cachedApplicationCacheNetworkState) === "number")
-                this._applicationCacheViews[frameId].updateNetworkState(this._cachedApplicationCacheNetworkState);
-        }
-
         this._innerShowView(this._applicationCacheViews[frameId]);
     },
 
@@ -631,7 +624,6 @@
     {
         var isNowOnline = event.data;
 
-        this._cachedApplicationCacheNetworkState = isNowOnline;
         for (var manifestURL in this._applicationCacheViews)
             this._applicationCacheViews[manifestURL].updateNetworkState(isNowOnline);
     },
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to