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

Unified Diff: chrome/browser/resources/options2/cookies_list.js

Issue 10536017: Refactoring CookiesTreeModel to support multiple data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mostly working, just need to refresh properly on Remove All Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options2/cookies_list.js
diff --git a/chrome/browser/resources/options2/cookies_list.js b/chrome/browser/resources/options2/cookies_list.js
index 8a4ae577c02f4d747b0f37eddc89e8d827ab04ff..51e47e3cc29b7e36488f5ef92e96bbd49e2eef08 100644
--- a/chrome/browser/resources/options2/cookies_list.js
+++ b/chrome/browser/resources/options2/cookies_list.js
@@ -605,6 +605,9 @@ cr.define('options', function() {
var parent = this.parent;
if (parent && parent instanceof CookieTreeNode)
return parent.pathId + ',' + this.data.id;
+ if ($('cookies-list').rootId) {
+ return $('cookies-list').rootId + ',' + this.data.id;
+ }
return this.data.id;
},
};
@@ -826,8 +829,13 @@ cr.define('options', function() {
*/
removeByParentId: function(parentId, start, count) {
var parent = parentId ? parentLookup[parentId] : this;
- if (!parent)
- return;
+ if (!parent) {
+ if (parentId) {
+ parent = this;
+ } else {
+ return;
+ }
+ }
parent.startBatchUpdates();
while (count-- > 0)
@@ -847,8 +855,13 @@ cr.define('options', function() {
if (parentId)
delete lookupRequests[parentId];
var parent = parentId ? parentLookup[parentId] : this;
- if (!parent)
- return;
+ if (!parent) {
+ if (parentId) {
+ parent = this;
+ } else {
+ return;
+ }
+ }
parent.startBatchUpdates();
parent.clear();

Powered by Google App Engine
This is Rietveld 408576698