Commit de3b60df authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

2010-02-04 Pavel Feldman <pfeldman@chromium.org>

        Reviewed by Timothy Hatcher.

        Web Inspector: group cookies by frame, show total
        cookies size, allow sorting cookie table.

        https://bugs.webkit.org/show_bug.cgi?id=34617

        * English.lproj/localizedStrings.js:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::deleteCookie):
        * inspector/front-end/CookieItemsView.js:
        (WebInspector.CookieItemsView):
        (WebInspector.CookieItemsView.prototype.update):
        (WebInspector.CookieItemsView.prototype._updateWithCookies):
        (WebInspector.CookieItemsView.prototype._cookiesForDomain):
        (WebInspector.CookieItemsView.prototype.dataGridForCookies):
        (WebInspector.CookieItemsView.prototype._createNodes):
        (WebInspector.CookieItemsView.prototype._sortData.localeCompare):
        (WebInspector.CookieItemsView.prototype._sortData.numberCompare):
        (WebInspector.CookieItemsView.prototype._sortData.expiresCompare):
        (WebInspector.CookieItemsView.prototype._sortData):
        * inspector/front-end/StoragePanel.js:
        (WebInspector.StoragePanel.prototype.showCookies):
        (WebInspector.CookieSidebarTreeElement):
        (WebInspector.CookieSidebarTreeElement.prototype.onselect):
        (WebInspector.CookieSidebarTreeElement.prototype.get subtitle):
        (WebInspector.CookieSidebarTreeElement.prototype.set subtitle):
        * inspector/front-end/inspector.js:
        (WebInspector.updateResource):


git-svn-id: svn://svn.chromium.org/blink/trunk@54435 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7143c196
2010-02-04 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: group cookies by frame, show total
cookies size, allow sorting cookie table.
https://bugs.webkit.org/show_bug.cgi?id=34617
* English.lproj/localizedStrings.js:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::deleteCookie):
* inspector/front-end/CookieItemsView.js:
(WebInspector.CookieItemsView):
(WebInspector.CookieItemsView.prototype.update):
(WebInspector.CookieItemsView.prototype._updateWithCookies):
(WebInspector.CookieItemsView.prototype._cookiesForDomain):
(WebInspector.CookieItemsView.prototype.dataGridForCookies):
(WebInspector.CookieItemsView.prototype._createNodes):
(WebInspector.CookieItemsView.prototype._sortData.localeCompare):
(WebInspector.CookieItemsView.prototype._sortData.numberCompare):
(WebInspector.CookieItemsView.prototype._sortData.expiresCompare):
(WebInspector.CookieItemsView.prototype._sortData):
* inspector/front-end/StoragePanel.js:
(WebInspector.StoragePanel.prototype.showCookies):
(WebInspector.CookieSidebarTreeElement):
(WebInspector.CookieSidebarTreeElement.prototype.onselect):
(WebInspector.CookieSidebarTreeElement.prototype.get subtitle):
(WebInspector.CookieSidebarTreeElement.prototype.set subtitle):
* inspector/front-end/inspector.js:
(WebInspector.updateResource):
2010-02-05 Maxime Simone <simon.maxime@gmail.com> 2010-02-05 Maxime Simone <simon.maxime@gmail.com>
Reviewed by David Levin. Reviewed by David Levin.
......
Bvar localizedStrings = new Object; Bvar localizedStrings = new Object;
......
...@@ -1802,7 +1802,7 @@ void InspectorController::deleteCookie(const String& cookieName, const String& d ...@@ -1802,7 +1802,7 @@ void InspectorController::deleteCookie(const String& cookieName, const String& d
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) { for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
Document* document = it->second->frame()->document(); Document* document = it->second->frame()->document();
if (document->url().host() == domain) if (document->url().host() == domain)
WebCore::deleteCookie(document, document->cookieURL(), cookieName); WebCore::deleteCookie(document, it->second->requestURL(), cookieName);
} }
} }
......
...@@ -220,14 +220,14 @@ WebInspector.StoragePanel.prototype = { ...@@ -220,14 +220,14 @@ WebInspector.StoragePanel.prototype = {
this.storageViewStatusBarItemsContainer.appendChild(statusBarItems[i]); this.storageViewStatusBarItemsContainer.appendChild(statusBarItems[i]);
}, },
showCookies: function(cookieDomain) showCookies: function(treeElement, cookieDomain)
{ {
if (this.visibleView) if (this.visibleView)
this.visibleView.hide(); this.visibleView.hide();
var view = this._cookieViews[cookieDomain]; var view = this._cookieViews[cookieDomain];
if (!view) { if (!view) {
view = new WebInspector.CookieItemsView(cookieDomain); view = new WebInspector.CookieItemsView(treeElement, cookieDomain);
this._cookieViews[cookieDomain] = view; this._cookieViews[cookieDomain] = view;
} }
...@@ -507,6 +507,7 @@ WebInspector.CookieSidebarTreeElement = function(cookieDomain) ...@@ -507,6 +507,7 @@ WebInspector.CookieSidebarTreeElement = function(cookieDomain)
{ {
WebInspector.SidebarTreeElement.call(this, "cookie-sidebar-tree-item", cookieDomain, "", null, false); WebInspector.SidebarTreeElement.call(this, "cookie-sidebar-tree-item", cookieDomain, "", null, false);
this._cookieDomain = cookieDomain; this._cookieDomain = cookieDomain;
this._subtitle = "";
this.refreshTitles(); this.refreshTitles();
} }
...@@ -514,9 +515,9 @@ WebInspector.CookieSidebarTreeElement = function(cookieDomain) ...@@ -514,9 +515,9 @@ WebInspector.CookieSidebarTreeElement = function(cookieDomain)
WebInspector.CookieSidebarTreeElement.prototype = { WebInspector.CookieSidebarTreeElement.prototype = {
onselect: function() onselect: function()
{ {
WebInspector.panels.storage.showCookies(this._cookieDomain); WebInspector.panels.storage.showCookies(this, this._cookieDomain);
}, },
get mainTitle() get mainTitle()
{ {
return this._cookieDomain ? this._cookieDomain : WebInspector.UIString("Local Files"); return this._cookieDomain ? this._cookieDomain : WebInspector.UIString("Local Files");
...@@ -529,12 +530,13 @@ WebInspector.CookieSidebarTreeElement.prototype = { ...@@ -529,12 +530,13 @@ WebInspector.CookieSidebarTreeElement.prototype = {
get subtitle() get subtitle()
{ {
return ""; return this._subtitle;
}, },
set subtitle(x) set subtitle(x)
{ {
// Do nothing. this._subtitle = x;
this.refreshTitles();
} }
} }
......
...@@ -1046,7 +1046,12 @@ WebInspector.updateResource = function(identifier, payload) ...@@ -1046,7 +1046,12 @@ WebInspector.updateResource = function(identifier, payload)
if (resource.mainResource) if (resource.mainResource)
this.mainResource = resource; this.mainResource = resource;
this._addCookieDomain(resource.domain); var match = payload.documentURL.match(WebInspector.URLRegExp);
if (match) {
var protocol = match[1].toLowerCase();
if (protocol.indexOf("http") === 0 || protocol === "file")
this._addCookieDomain(protocol === "file" ? "" : match[2]);
}
} }
if (payload.didResponseChange) { if (payload.didResponseChange) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment