Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js

Issue 2623063003: DevTools: Fix getCookies to report for all resources (Closed)
Patch Set: more feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 /** 384 /**
385 * @param {!Resources.DatabaseModel.DatabaseAddedEvent} event 385 * @param {!Resources.DatabaseModel.DatabaseAddedEvent} event
386 */ 386 */
387 _databaseAdded(event) { 387 _databaseAdded(event) {
388 var databaseTreeElement = new Resources.DatabaseTreeElement(this, event.data base); 388 var databaseTreeElement = new Resources.DatabaseTreeElement(this, event.data base);
389 this._databaseTreeElements.set(event.database, databaseTreeElement); 389 this._databaseTreeElements.set(event.database, databaseTreeElement);
390 this.databasesListTreeElement.appendChild(databaseTreeElement); 390 this.databasesListTreeElement.appendChild(databaseTreeElement);
391 } 391 }
392 392
393 addDocumentURL(url) { 393 /**
394 var parsedURL = url.asParsedURL(); 394 * @param {!SDK.ResourceTreeFrame} frame
395 */
396 addCookieDocument(frame) {
397 var parsedURL = frame.url.asParsedURL();
395 if (!parsedURL) 398 if (!parsedURL)
396 return; 399 return;
397 400
398 var domain = parsedURL.securityOrigin(); 401 var domain = parsedURL.securityOrigin();
399 if (!this._domains[domain]) { 402 if (!this._domains[domain]) {
400 this._domains[domain] = true; 403 this._domains[domain] = true;
401 var cookieDomainTreeElement = new Resources.CookieTreeElement(this, domain ); 404 var cookieDomainTreeElement = new Resources.CookieTreeElement(this, frame, domain);
402 this.cookieListTreeElement.appendChild(cookieDomainTreeElement); 405 this.cookieListTreeElement.appendChild(cookieDomainTreeElement);
403 } 406 }
404 } 407 }
405 408
406 /** 409 /**
407 * @param {!Common.Event} event 410 * @param {!Common.Event} event
408 */ 411 */
409 _domStorageAdded(event) { 412 _domStorageAdded(event) {
410 var domStorage = /** @type {!Resources.DOMStorage} */ (event.data); 413 var domStorage = /** @type {!Resources.DOMStorage} */ (event.data);
411 this._addDOMStorage(domStorage); 414 this._addDOMStorage(domStorage);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 view = new Resources.DOMStorageItemsView(domStorage); 578 view = new Resources.DOMStorageItemsView(domStorage);
576 this._domStorageViews.set(domStorage, view); 579 this._domStorageViews.set(domStorage, view);
577 } 580 }
578 581
579 this._innerShowView(view); 582 this._innerShowView(view);
580 } 583 }
581 584
582 /** 585 /**
583 * @param {!Resources.CookieTreeElement} treeElement 586 * @param {!Resources.CookieTreeElement} treeElement
584 * @param {string} cookieDomain 587 * @param {string} cookieDomain
588 * @param {!SDK.ResourceTreeFrame} cookieFrameTarget
585 */ 589 */
586 showCookies(treeElement, cookieDomain) { 590 showCookies(treeElement, cookieDomain, cookieFrameTarget) {
587 var view = this._cookieViews[cookieDomain]; 591 var view = this._cookieViews[cookieDomain];
588 if (!view) { 592 if (!view) {
589 view = new Resources.CookieItemsView(treeElement, cookieDomain); 593 view = new Resources.CookieItemsView(treeElement, cookieFrameTarget, cooki eDomain);
590 this._cookieViews[cookieDomain] = view; 594 this._cookieViews[cookieDomain] = view;
591 } 595 }
592 596
593 this._innerShowView(view); 597 this._innerShowView(view);
594 } 598 }
595 599
596 /** 600 /**
597 * @param {string} cookieDomain 601 * @param {string} cookieDomain
598 */ 602 */
599 clearCookies(cookieDomain) { 603 clearCookies(cookieDomain) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 this.frameNavigated(frame); 942 this.frameNavigated(frame);
939 } 943 }
940 944
941 frameNavigated(frame) { 945 frameNavigated(frame) {
942 this.removeChildren(); 946 this.removeChildren();
943 this._frameId = frame.id; 947 this._frameId = frame.id;
944 this.title = frame.displayName(); 948 this.title = frame.displayName();
945 this._categoryElements = {}; 949 this._categoryElements = {};
946 this._treeElementForResource = {}; 950 this._treeElementForResource = {};
947 951
948 this._storagePanel.addDocumentURL(frame.url); 952 this._storagePanel.addCookieDocument(frame);
949 } 953 }
950 954
951 get itemURL() { 955 get itemURL() {
952 return 'frame://' + encodeURI(this.titleAsText()); 956 return 'frame://' + encodeURI(this.titleAsText());
953 } 957 }
954 958
955 /** 959 /**
956 * @override 960 * @override
957 * @return {boolean} 961 * @return {boolean}
958 */ 962 */
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 super.onselect(selectedByUser); 1905 super.onselect(selectedByUser);
1902 this._storagePanel._showDOMStorage(this._domStorage); 1906 this._storagePanel._showDOMStorage(this._domStorage);
1903 return false; 1907 return false;
1904 } 1908 }
1905 }; 1909 };
1906 1910
1907 /** 1911 /**
1908 * @unrestricted 1912 * @unrestricted
1909 */ 1913 */
1910 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement { 1914 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement {
1911 constructor(storagePanel, cookieDomain) { 1915 constructor(storagePanel, frame, cookieDomain) {
1912 super( 1916 super(
1913 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '), 1917 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '),
1914 ['cookie-tree-item', 'resource-tree-item']); 1918 ['cookie-tree-item', 'resource-tree-item']);
1919 this._frame = frame;
1915 this._cookieDomain = cookieDomain; 1920 this._cookieDomain = cookieDomain;
1916 } 1921 }
1917 1922
1918 get itemURL() { 1923 get itemURL() {
1919 return 'cookies://' + this._cookieDomain; 1924 return 'cookies://' + this._cookieDomain;
1920 } 1925 }
1921 1926
1922 /** 1927 /**
1923 * @override 1928 * @override
1924 */ 1929 */
(...skipping 17 matching lines...) Expand all
1942 _clearCookies(domain) { 1947 _clearCookies(domain) {
1943 this._storagePanel.clearCookies(this._cookieDomain); 1948 this._storagePanel.clearCookies(this._cookieDomain);
1944 } 1949 }
1945 1950
1946 /** 1951 /**
1947 * @override 1952 * @override
1948 * @return {boolean} 1953 * @return {boolean}
1949 */ 1954 */
1950 onselect(selectedByUser) { 1955 onselect(selectedByUser) {
1951 super.onselect(selectedByUser); 1956 super.onselect(selectedByUser);
1952 this._storagePanel.showCookies(this, this._cookieDomain); 1957 this._storagePanel.showCookies(this, this._cookieDomain, this._frame.target( ));
1953 return false; 1958 return false;
1954 } 1959 }
1955 }; 1960 };
1956 1961
1957 /** 1962 /**
1958 * @unrestricted 1963 * @unrestricted
1959 */ 1964 */
1960 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement { 1965 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement {
1961 constructor(storagePanel, manifestURL) { 1966 constructor(storagePanel, manifestURL) {
1962 var title = new Common.ParsedURL(manifestURL).displayName; 1967 var title = new Common.ParsedURL(manifestURL).displayName;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 2047
2043 this.element.classList.add('storage-view'); 2048 this.element.classList.add('storage-view');
2044 this._emptyWidget = new UI.EmptyWidget(''); 2049 this._emptyWidget = new UI.EmptyWidget('');
2045 this._emptyWidget.show(this.element); 2050 this._emptyWidget.show(this.element);
2046 } 2051 }
2047 2052
2048 setText(text) { 2053 setText(text) {
2049 this._emptyWidget.text = text; 2054 this._emptyWidget.text = text;
2050 } 2055 }
2051 }; 2056 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698