| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function() { | 5 (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * 'site-data-details-subpage' Display cookie contents. | 9 * 'site-data-details-subpage' Display cookie contents. |
| 10 */ | 10 */ |
| 11 Polymer({ | 11 Polymer({ |
| 12 is: 'site-data-details-subpage', | 12 is: 'site-data-details-subpage', |
| 13 | 13 |
| 14 behaviors: [settings.RouteObserverBehavior, WebUIListenerBehavior], | 14 behaviors: [settings.RouteObserverBehavior, WebUIListenerBehavior], |
| 15 | 15 |
| 16 properties: { | 16 properties: { |
| 17 /** | 17 /** |
| 18 * The browser proxy used to retrieve and change cookies. | 18 * The browser proxy used to retrieve and change cookies. |
| 19 * @type {settings.SiteSettingsPrefsBrowserProxy} | 19 * @type {settings.SiteSettingsPrefsBrowserProxy} |
| 20 */ | 20 */ |
| 21 browserProxy: Object, | 21 browserProxy: Object, |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * The cookie entries for the given site. | 24 * The cookie entries for the given site. |
| 25 * @type {!Array<!CookieDataItem>} | 25 * @type {!Array<!CookieDetails>} |
| 26 * @private | 26 * @private |
| 27 */ | 27 */ |
| 28 entries_: Array, | 28 entries_: Array, |
| 29 | 29 |
| 30 /** Set the page title on the settings-subpage parent. */ | 30 /** Set the page title on the settings-subpage parent. */ |
| 31 pageTitle: { | 31 pageTitle: { |
| 32 type: String, | 32 type: String, |
| 33 notify: true, | 33 notify: true, |
| 34 }, | 34 }, |
| 35 | 35 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * @return {!Array<!CookieDataForDisplay>} | 78 * @return {!Array<!CookieDataForDisplay>} |
| 79 * @private | 79 * @private |
| 80 */ | 80 */ |
| 81 getCookieNodes_: function(node) { | 81 getCookieNodes_: function(node) { |
| 82 return getCookieData(node); | 82 return getCookieData(node); |
| 83 }, | 83 }, |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * @param {!CookieDataSummaryItem} cookies | 86 * @param {!CookieList} cookies |
| 87 * @private | 87 * @private |
| 88 */ | 88 */ |
| 89 onCookiesLoaded_: function(cookies) { | 89 onCookiesLoaded_: function(cookies) { |
| 90 this.siteId_ = cookies.id; | 90 this.siteId_ = cookies.id; |
| 91 this.entries_ = cookies.children; | 91 this.entries_ = cookies.children; |
| 92 // Set up flag for expanding cookie details. | 92 // Set up flag for expanding cookie details. |
| 93 this.entries_.map(function(e) { return e.expanded_ = false; }); | 93 this.entries_.forEach(function(e) { e.expanded_ = false; }); |
| 94 }, | 94 }, |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * The site was not found. E.g. The site data may have been deleted or the | 97 * The site was not found. E.g. The site data may have been deleted or the |
| 98 * site URL parameter may be mistyped. | 98 * site URL parameter may be mistyped. |
| 99 * @private | 99 * @private |
| 100 */ | 100 */ |
| 101 onCookiesLoadFailed_: function() { | 101 onCookiesLoadFailed_: function() { |
| 102 this.siteId_ = ''; | 102 this.siteId_ = ''; |
| 103 this.entries_ = []; | 103 this.entries_ = []; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * A handler for when the user opts to remove all cookies. | 132 * A handler for when the user opts to remove all cookies. |
| 133 */ | 133 */ |
| 134 removeAll: function() { | 134 removeAll: function() { |
| 135 this.browserProxy.removeCookie(this.siteId_); | 135 this.browserProxy.removeCookie(this.siteId_); |
| 136 }, | 136 }, |
| 137 }); | 137 }); |
| 138 | 138 |
| 139 })(); | 139 })(); |
| OLD | NEW |