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

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_data_details_dialog.js

Issue 2248683006: Site Settings Desktop: Implement individual cookie removal and RemoveAll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 4 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 6 * @fileoverview
7 * 'site-data-details-dialog' provides a dialog to show details of site data 7 * 'site-data-details-dialog' provides a dialog to show details of site data
8 * stored by a given site. 8 * stored by a given site.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 while (root.lastChild) { 114 while (root.lastChild) {
115 root.removeChild(root.lastChild); 115 root.removeChild(root.lastChild);
116 } 116 }
117 117
118 // In with the new... 118 // In with the new...
119 var node = site.fetchNodeById(id, true); 119 var node = site.fetchNodeById(id, true);
120 if (node) 120 if (node)
121 site.addCookieData(root, node); 121 site.addCookieData(root, node);
122 }, 122 },
123 123
124 /** @private */ 124 /**
125 * Called when a single item has been removed.
126 * @param {!CookieRemovePacket} args The details about what to remove.
127 * @private
128 */
125 onTreeItemRemoved_: function(args) { 129 onTreeItemRemoved_: function(args) {
126 this.entries_ = this.site_.getCookieList(); 130 this.entries_ = this.site_.getCookieList();
127 if (args[0] == this.site_.data_.id || this.entries_.length == 0) { 131 if (args.id == this.site_.data_.id || this.entries_.length == 0) {
128 this.$.dialog.close(); 132 this.$.dialog.close();
129 return; 133 return;
130 } 134 }
131 135
132 if (this.entries_.length <= this.lastSelectedIndex_) 136 if (this.entries_.length <= this.lastSelectedIndex_)
133 this.lastSelectedIndex_ = this.entries_.length - 1; 137 this.lastSelectedIndex_ = this.entries_.length - 1;
134 var selectedId = this.entries_[this.lastSelectedIndex_].id; 138 var selectedId = this.entries_[this.lastSelectedIndex_].id;
135 this.$.picker.selected = selectedId; 139 this.$.picker.selected = selectedId;
136 this.populateItem_(selectedId, this.site_); 140 this.populateItem_(selectedId, this.site_);
137 }, 141 },
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 cr.removeWebUIListener(this.listener_); 174 cr.removeWebUIListener(this.listener_);
171 this.browserProxy.removeCookie(this.site_.data_.id); 175 this.browserProxy.removeCookie(this.site_.data_.id);
172 this.$.dialog.close(); 176 this.$.dialog.close();
173 }, 177 },
174 178
175 /** @private */ 179 /** @private */
176 onCancelTap_: function() { 180 onCancelTap_: function() {
177 this.$.dialog.cancel(); 181 this.$.dialog.cancel();
178 }, 182 },
179 }); 183 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698