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

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: Fixed all comments by Evan. 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..2db5d87e1f250c5ad77c88e1b69f80cb7e787df6 100644
--- a/chrome/browser/resources/options2/cookies_list.js
+++ b/chrome/browser/resources/options2/cookies_list.js
@@ -605,6 +605,11 @@ cr.define('options', function() {
var parent = this.parent;
if (parent && parent instanceof CookieTreeNode)
return parent.pathId + ',' + this.data.id;
+ // TODO(nasko): until the code is modified to account for the "app" level
+ // in the tree model, use this hack of adding the root node id.
+ if ($('cookies-list').rootId)
+ return $('cookies-list').rootId + ',' + this.data.id;
+
return this.data.id;
},
};
@@ -826,8 +831,15 @@ cr.define('options', function() {
*/
removeByParentId: function(parentId, start, count) {
var parent = parentId ? parentLookup[parentId] : this;
- if (!parent)
- return;
+ if (!parent) {
+ // TODO(nasko): Remove this once the "app" level in the tree model is
+ // accounted for.
+ if (parentId) {
Evan Stade 2012/06/21 04:01:41 I think parentId has to be truthy at this point, b
nasko 2012/06/21 16:22:12 Since I've added a new level in the tree, it no lo
Evan Stade 2012/06/21 18:40:02 if the parentId is valid then why are you checking
nasko 2012/06/21 18:49:47 Because, while there is a parent node (the root no
Evan Stade 2012/06/22 00:59:47 I'm not really following you any more. And I don't
nasko 2012/06/22 17:59:35 I see what your point is. You are indeed correct.
+ parent = this;
+ } else {
+ return;
Evan Stade 2012/06/22 00:59:47 my point is that this line cannot be reached. It i
+ }
+ }
parent.startBatchUpdates();
while (count-- > 0)
@@ -847,8 +859,15 @@ cr.define('options', function() {
if (parentId)
delete lookupRequests[parentId];
var parent = parentId ? parentLookup[parentId] : this;
- if (!parent)
- return;
+ // TODO(nasko): Remove this once the "app" level in the tree model is
+ // accounted for.
+ if (!parent) {
+ if (parentId) {
Evan Stade 2012/06/21 04:01:41 ditto
nasko 2012/06/21 16:22:12 See the above.
+ parent = this;
+ } else {
+ return;
+ }
+ }
parent.startBatchUpdates();
parent.clear();

Powered by Google App Engine
This is Rietveld 408576698