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

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: rebase master 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 var contextMenu = new UI.ContextMenu(event); 1919 var contextMenu = new UI.ContextMenu(event);
1916 contextMenu.appendItem(Common.UIString('Clear'), () => this._domStorage.clea r()); 1920 contextMenu.appendItem(Common.UIString('Clear'), () => this._domStorage.clea r());
1917 contextMenu.show(); 1921 contextMenu.show();
1918 } 1922 }
1919 }; 1923 };
1920 1924
1921 /** 1925 /**
1922 * @unrestricted 1926 * @unrestricted
1923 */ 1927 */
1924 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement { 1928 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement {
1925 constructor(storagePanel, cookieDomain) { 1929 constructor(storagePanel, frame, cookieDomain) {
1926 super( 1930 super(
1927 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '), 1931 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '),
1928 ['cookie-tree-item', 'resource-tree-item']); 1932 ['cookie-tree-item', 'resource-tree-item']);
1933 this._frame = frame;
1929 this._cookieDomain = cookieDomain; 1934 this._cookieDomain = cookieDomain;
1930 } 1935 }
1931 1936
1932 get itemURL() { 1937 get itemURL() {
1933 return 'cookies://' + this._cookieDomain; 1938 return 'cookies://' + this._cookieDomain;
1934 } 1939 }
1935 1940
1936 /** 1941 /**
1937 * @override 1942 * @override
1938 */ 1943 */
(...skipping 17 matching lines...) Expand all
1956 _clearCookies(domain) { 1961 _clearCookies(domain) {
1957 this._storagePanel.clearCookies(this._cookieDomain); 1962 this._storagePanel.clearCookies(this._cookieDomain);
1958 } 1963 }
1959 1964
1960 /** 1965 /**
1961 * @override 1966 * @override
1962 * @return {boolean} 1967 * @return {boolean}
1963 */ 1968 */
1964 onselect(selectedByUser) { 1969 onselect(selectedByUser) {
1965 super.onselect(selectedByUser); 1970 super.onselect(selectedByUser);
1966 this._storagePanel.showCookies(this, this._cookieDomain); 1971 this._storagePanel.showCookies(this, this._cookieDomain, this._frame.target( ));
1967 return false; 1972 return false;
1968 } 1973 }
1969 }; 1974 };
1970 1975
1971 /** 1976 /**
1972 * @unrestricted 1977 * @unrestricted
1973 */ 1978 */
1974 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement { 1979 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement {
1975 constructor(storagePanel, manifestURL) { 1980 constructor(storagePanel, manifestURL) {
1976 var title = new Common.ParsedURL(manifestURL).displayName; 1981 var title = new Common.ParsedURL(manifestURL).displayName;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 2061
2057 this.element.classList.add('storage-view'); 2062 this.element.classList.add('storage-view');
2058 this._emptyWidget = new UI.EmptyWidget(''); 2063 this._emptyWidget = new UI.EmptyWidget('');
2059 this._emptyWidget.show(this.element); 2064 this._emptyWidget.show(this.element);
2060 } 2065 }
2061 2066
2062 setText(text) { 2067 setText(text) {
2063 this._emptyWidget.text = text; 2068 this._emptyWidget.text = text;
2064 } 2069 }
2065 }; 2070 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698