| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * @param {!Array.<!SDK.Cookie>} allCookies | 85 * @param {!Array.<!SDK.Cookie>} allCookies |
| 86 */ | 86 */ |
| 87 _updateWithCookies(allCookies) { | 87 _updateWithCookies(allCookies) { |
| 88 this._totalSize = allCookies.reduce((size, cookie) => size + cookie.size(),
0); | 88 this._totalSize = allCookies.reduce((size, cookie) => size + cookie.size(),
0); |
| 89 | 89 |
| 90 if (!this._cookiesTable) { | 90 if (!this._cookiesTable) { |
| 91 this._cookiesTable = new CookieTable.CookiesTable( | 91 this._cookiesTable = new CookieTable.CookiesTable( |
| 92 this._saveCookie.bind(this), this.refreshItems.bind(this), () => this.
setCanDeleteSelected(true), | 92 this._saveCookie.bind(this), |
| 93 this.refreshItems.bind(this), |
| 94 () => this.setCanDeleteSelected(!!this._cookiesTable.selectedCookie())
, |
| 93 this._deleteCookie.bind(this)); | 95 this._deleteCookie.bind(this)); |
| 94 } | 96 } |
| 95 | 97 |
| 96 const parsedURL = this._cookieDomain.asParsedURL(); | 98 const parsedURL = this._cookieDomain.asParsedURL(); |
| 97 const host = parsedURL ? parsedURL.host : ''; | 99 const host = parsedURL ? parsedURL.host : ''; |
| 98 this._cookiesTable.setCookieDomain(host); | 100 this._cookiesTable.setCookieDomain(host); |
| 99 | 101 |
| 100 var shownCookies = this.filter(allCookies, cookie => `${cookie.name()} ${coo
kie.value()} ${cookie.domain()}`); | 102 var shownCookies = this.filter(allCookies, cookie => `${cookie.name()} ${coo
kie.value()} ${cookie.domain()}`); |
| 101 this._cookiesTable.setCookies(shownCookies); | 103 this._cookiesTable.setCookies(shownCookies); |
| 102 this._cookiesTable.show(this.element); | 104 this._cookiesTable.show(this.element); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 121 this._model.deleteCookie(selectedCookie, () => this.refreshItems()); | 123 this._model.deleteCookie(selectedCookie, () => this.refreshItems()); |
| 122 } | 124 } |
| 123 | 125 |
| 124 /** | 126 /** |
| 125 * @override | 127 * @override |
| 126 */ | 128 */ |
| 127 refreshItems() { | 129 refreshItems() { |
| 128 this._model.getCookiesForDomain(this._cookieDomain, cookies => this._updateW
ithCookies(cookies)); | 130 this._model.getCookiesForDomain(this._cookieDomain, cookies => this._updateW
ithCookies(cookies)); |
| 129 } | 131 } |
| 130 }; | 132 }; |
| OLD | NEW |