Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 addCookieDocument(frame) { |
|
pfeldman
2017/01/13 02:17:34
Annotation missing - you touched it...
phulce
2017/01/18 00:52:34
Done.
| |
| 394 var parsedURL = url.asParsedURL(); | 394 var parsedURL = frame.url.asParsedURL(); |
| 395 if (!parsedURL) | 395 if (!parsedURL) |
| 396 return; | 396 return; |
| 397 | 397 |
| 398 var domain = parsedURL.securityOrigin(); | 398 var domain = parsedURL.securityOrigin(); |
| 399 if (!this._domains[domain]) { | 399 if (!this._domains[domain]) { |
| 400 this._domains[domain] = true; | 400 this._domains[domain] = true; |
| 401 var cookieDomainTreeElement = new Resources.CookieTreeElement(this, domain ); | 401 var cookieDomainTreeElement = new Resources.CookieTreeElement(this, frame, domain); |
| 402 this.cookieListTreeElement.appendChild(cookieDomainTreeElement); | 402 this.cookieListTreeElement.appendChild(cookieDomainTreeElement); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 /** | 406 /** |
| 407 * @param {!Common.Event} event | 407 * @param {!Common.Event} event |
| 408 */ | 408 */ |
| 409 _domStorageAdded(event) { | 409 _domStorageAdded(event) { |
| 410 var domStorage = /** @type {!Resources.DOMStorage} */ (event.data); | 410 var domStorage = /** @type {!Resources.DOMStorage} */ (event.data); |
| 411 this._addDOMStorage(domStorage); | 411 this._addDOMStorage(domStorage); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 575 view = new Resources.DOMStorageItemsView(domStorage); | 575 view = new Resources.DOMStorageItemsView(domStorage); |
| 576 this._domStorageViews.set(domStorage, view); | 576 this._domStorageViews.set(domStorage, view); |
| 577 } | 577 } |
| 578 | 578 |
| 579 this._innerShowView(view); | 579 this._innerShowView(view); |
| 580 } | 580 } |
| 581 | 581 |
| 582 /** | 582 /** |
| 583 * @param {!Resources.CookieTreeElement} treeElement | 583 * @param {!Resources.CookieTreeElement} treeElement |
| 584 * @param {string} cookieDomain | 584 * @param {string} cookieDomain |
| 585 * @param {!Object} cookieFrameTarget | |
| 585 */ | 586 */ |
| 586 showCookies(treeElement, cookieDomain) { | 587 showCookies(treeElement, cookieDomain, cookieFrameTarget) { |
| 587 var view = this._cookieViews[cookieDomain]; | 588 var view = this._cookieViews[cookieDomain]; |
| 588 if (!view) { | 589 if (!view) { |
| 589 view = new Resources.CookieItemsView(treeElement, cookieDomain); | 590 view = new Resources.CookieItemsView(treeElement, cookieFrameTarget, cooki eDomain); |
| 590 this._cookieViews[cookieDomain] = view; | 591 this._cookieViews[cookieDomain] = view; |
| 591 } | 592 } |
| 592 | 593 |
| 593 this._innerShowView(view); | 594 this._innerShowView(view); |
| 594 } | 595 } |
| 595 | 596 |
| 596 /** | 597 /** |
| 597 * @param {string} cookieDomain | 598 * @param {string} cookieDomain |
| 598 */ | 599 */ |
| 599 clearCookies(cookieDomain) { | 600 clearCookies(cookieDomain) { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 this.frameNavigated(frame); | 939 this.frameNavigated(frame); |
| 939 } | 940 } |
| 940 | 941 |
| 941 frameNavigated(frame) { | 942 frameNavigated(frame) { |
| 942 this.removeChildren(); | 943 this.removeChildren(); |
| 943 this._frameId = frame.id; | 944 this._frameId = frame.id; |
| 944 this.title = frame.displayName(); | 945 this.title = frame.displayName(); |
| 945 this._categoryElements = {}; | 946 this._categoryElements = {}; |
| 946 this._treeElementForResource = {}; | 947 this._treeElementForResource = {}; |
| 947 | 948 |
| 948 this._storagePanel.addDocumentURL(frame.url); | 949 this._storagePanel.addCookieDocument(frame); |
| 949 } | 950 } |
| 950 | 951 |
| 951 get itemURL() { | 952 get itemURL() { |
| 952 return 'frame://' + encodeURI(this.titleAsText()); | 953 return 'frame://' + encodeURI(this.titleAsText()); |
| 953 } | 954 } |
| 954 | 955 |
| 955 /** | 956 /** |
| 956 * @override | 957 * @override |
| 957 * @return {boolean} | 958 * @return {boolean} |
| 958 */ | 959 */ |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1901 super.onselect(selectedByUser); | 1902 super.onselect(selectedByUser); |
| 1902 this._storagePanel._showDOMStorage(this._domStorage); | 1903 this._storagePanel._showDOMStorage(this._domStorage); |
| 1903 return false; | 1904 return false; |
| 1904 } | 1905 } |
| 1905 }; | 1906 }; |
| 1906 | 1907 |
| 1907 /** | 1908 /** |
| 1908 * @unrestricted | 1909 * @unrestricted |
| 1909 */ | 1910 */ |
| 1910 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement { | 1911 Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement { |
| 1911 constructor(storagePanel, cookieDomain) { | 1912 constructor(storagePanel, frame, cookieDomain) { |
| 1912 super( | 1913 super( |
| 1913 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '), | 1914 storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files '), |
| 1914 ['cookie-tree-item', 'resource-tree-item']); | 1915 ['cookie-tree-item', 'resource-tree-item']); |
| 1916 this._frame = frame; | |
| 1915 this._cookieDomain = cookieDomain; | 1917 this._cookieDomain = cookieDomain; |
| 1916 } | 1918 } |
| 1917 | 1919 |
| 1918 get itemURL() { | 1920 get itemURL() { |
| 1919 return 'cookies://' + this._cookieDomain; | 1921 return 'cookies://' + this._cookieDomain; |
| 1920 } | 1922 } |
| 1921 | 1923 |
| 1922 /** | 1924 /** |
| 1923 * @override | 1925 * @override |
| 1924 */ | 1926 */ |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1942 _clearCookies(domain) { | 1944 _clearCookies(domain) { |
| 1943 this._storagePanel.clearCookies(this._cookieDomain); | 1945 this._storagePanel.clearCookies(this._cookieDomain); |
| 1944 } | 1946 } |
| 1945 | 1947 |
| 1946 /** | 1948 /** |
| 1947 * @override | 1949 * @override |
| 1948 * @return {boolean} | 1950 * @return {boolean} |
| 1949 */ | 1951 */ |
| 1950 onselect(selectedByUser) { | 1952 onselect(selectedByUser) { |
| 1951 super.onselect(selectedByUser); | 1953 super.onselect(selectedByUser); |
| 1952 this._storagePanel.showCookies(this, this._cookieDomain); | 1954 this._storagePanel.showCookies(this, this._cookieDomain, this._frame.target( )); |
| 1953 return false; | 1955 return false; |
| 1954 } | 1956 } |
| 1955 }; | 1957 }; |
| 1956 | 1958 |
| 1957 /** | 1959 /** |
| 1958 * @unrestricted | 1960 * @unrestricted |
| 1959 */ | 1961 */ |
| 1960 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement { | 1962 Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor ageTreeElement { |
| 1961 constructor(storagePanel, manifestURL) { | 1963 constructor(storagePanel, manifestURL) { |
| 1962 var title = new Common.ParsedURL(manifestURL).displayName; | 1964 var title = new Common.ParsedURL(manifestURL).displayName; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2042 | 2044 |
| 2043 this.element.classList.add('storage-view'); | 2045 this.element.classList.add('storage-view'); |
| 2044 this._emptyWidget = new UI.EmptyWidget(''); | 2046 this._emptyWidget = new UI.EmptyWidget(''); |
| 2045 this._emptyWidget.show(this.element); | 2047 this._emptyWidget.show(this.element); |
| 2046 } | 2048 } |
| 2047 | 2049 |
| 2048 setText(text) { | 2050 setText(text) { |
| 2049 this._emptyWidget.text = text; | 2051 this._emptyWidget.text = text; |
| 2050 } | 2052 } |
| 2051 }; | 2053 }; |
| OLD | NEW |