Changeset 100894 in webkit


Ignore:
Timestamp:
Nov 21, 2011 2:22:00 AM (12 years ago)
Author:
vsevik@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r100893 r100894  
     12011-11-21  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: ApplicationCache view should show navigator.onLine indicator.
     4        https://bugs.webkit.org/show_bug.cgi?id=72618
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/InspectorApplicationCacheAgent.cpp:
     9        (WebCore::InspectorApplicationCacheAgent::enable):
     10        * inspector/front-end/ApplicationCacheItemsView.js:
     11        (WebInspector.ApplicationCacheItemsView):
     12        (WebInspector.ApplicationCacheItemsView.prototype.wasShown):
     13        * inspector/front-end/ApplicationCacheModel.js:
     14        (WebInspector.ApplicationCacheModel):
     15        (WebInspector.ApplicationCacheModel.prototype.get onLine):
     16        (WebInspector.ApplicationCacheModel.prototype._networkStateUpdated):
     17        * inspector/front-end/ResourcesPanel.js:
     18        (WebInspector.ResourcesPanel.prototype.showApplicationCache):
     19        (WebInspector.ResourcesPanel.prototype._applicationCacheNetworkStateChanged):
     20
    1212011-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp

    r99988 r100894  
    8080    m_state->setBoolean(ApplicationCacheAgentState::applicationCacheAgentEnabled, true);
    8181    m_instrumentingAgents->setInspectorApplicationCacheAgent(this);
     82
     83    // We need to pass initial navigator.onOnline.
     84    networkStateChanged();
    8285}
    8386
  • trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js

    r100635 r100894  
    2828 * @extends {WebInspector.View}
    2929 */
    30 WebInspector.ApplicationCacheItemsView = function(model, frameId, status)
     30WebInspector.ApplicationCacheItemsView = function(model, frameId)
    3131{
    3232    WebInspector.View.call(this);
     
    6565
    6666    this._markDirty();
     67   
     68    var status = this._model.frameManifestStatus(frameId);
    6769    this.updateStatus(status);
     70   
     71    this.updateNetworkState(this._model.onLine);
    6872
    6973    // FIXME: Status bar items don't work well enough yet, so they are being hidden.
    7074    // http://webkit.org/b/41637 Web Inspector: Give Semantics to "Refresh" and "Delete" Buttons in ApplicationCache DataGrid
    71     // http://webkit.org/b/72618 Web Inspector: ApplicationCache view should show navigator.onLine indicator.
    7275    this.deleteButton.element.style.display = "none";
    73     this.connectivityIcon.style.display = "none";
    74     this.connectivityMessage.style.display = "none";
    75     this.divider.style.display = "none";
    7676}
    7777
     
    8888    wasShown: function()
    8989    {
    90         this.updateNetworkState(navigator.onLine);
    9190        this._maybeUpdate();
    9291    },
  • trunk/Source/WebCore/inspector/front-end/ApplicationCacheModel.js

    r99878 r100894  
    4343
    4444    this._mainFrameNavigated();
     45   
     46    this._onLine = true;
    4547}
    4648
     
    168170    {
    169171        return this._statuses[frameId] || applicationCache.UNCACHED;
     172    },
     173   
     174    /**
     175     * @return {number}
     176     */
     177    get onLine()
     178    {
     179        return this._onLine;
    170180    },
    171181   
     
    205215    _networkStateUpdated: function(isNowOnline)
    206216    {
     217        this._onLine = isNowOnline;
    207218        this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.NetworkStateChanged, isNowOnline);
    208219    }
  • trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js

    r99965 r100894  
    480480    showApplicationCache: function(frameId)
    481481    {
    482         var status = this._applicationCacheModel.frameManifestStatus(frameId)
    483 
    484         if (!this._applicationCacheViews[frameId]) {
    485             this._applicationCacheViews[frameId] = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, frameId, status);
    486 
    487             // FIXME: Make sure this._cachedApplicationCacheNetworkState is always set and is always up to date.
    488             if (typeof(this._cachedApplicationCacheNetworkState) === "number")
    489                 this._applicationCacheViews[frameId].updateNetworkState(this._cachedApplicationCacheNetworkState);
    490         }
     482        if (!this._applicationCacheViews[frameId])
     483            this._applicationCacheViews[frameId] = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, frameId);
    491484
    492485        this._innerShowView(this._applicationCacheViews[frameId]);
     
    632625        var isNowOnline = event.data;
    633626
    634         this._cachedApplicationCacheNetworkState = isNowOnline;
    635627        for (var manifestURL in this._applicationCacheViews)
    636628            this._applicationCacheViews[manifestURL].updateNetworkState(isNowOnline);
Note: See TracChangeset for help on using the changeset viewer.