| 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 /** | 5 /** |
| 6 * @fileoverview A behavior for managing a tree of cookies. | 6 * @fileoverview A behavior for managing a tree of cookies. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** @polymerBehavior */ | 9 /** @polymerBehavior */ |
| 10 var CookieTreeBehaviorImpl = { | 10 var CookieTreeBehaviorImpl = { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Called when a single item has been removed (not during delete all). | 79 * Called when a single item has been removed (not during delete all). |
| 80 * @param {!CookieRemovePacket} args The details about what to remove. | 80 * @param {!CookieRemovePacket} args The details about what to remove. |
| 81 * @private | 81 * @private |
| 82 */ | 82 */ |
| 83 onTreeItemRemoved_: function(args) { | 83 onTreeItemRemoved_: function(args) { |
| 84 this.rootCookieNode.removeByParentId(args.id, args.start, args.count); | 84 this.rootCookieNode.removeByParentId(args.id, args.start, args.count); |
| 85 this.sites = this.rootCookieNode.getSummaryList(); | 85 this.sites = this.rootCookieNode.getSummaryList(); |
| 86 this.fire('cookie-tree-changed'); | |
| 87 }, | 86 }, |
| 88 | 87 |
| 89 /** | 88 /** |
| 90 * Deletes site data for multiple sites. | 89 * Deletes site data for multiple sites. |
| 91 * @return {Promise} | 90 * @return {Promise} |
| 92 */ | 91 */ |
| 93 removeAllCookies: function() { | 92 removeAllCookies: function() { |
| 94 return this.browserProxy.removeAllCookies().then( | 93 return this.browserProxy.removeAllCookies().then( |
| 95 this.loadChildren_.bind(this)); | 94 this.loadChildren_.bind(this)); |
| 96 }, | 95 }, |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 /** @polymerBehavior */ | 98 /** @polymerBehavior */ |
| 100 var CookieTreeBehavior = [SiteSettingsBehavior, CookieTreeBehaviorImpl]; | 99 var CookieTreeBehavior = [SiteSettingsBehavior, CookieTreeBehaviorImpl]; |
| OLD | NEW |