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

Unified Diff: chrome/browser/resources/bookmark_manager/main.html

Issue 6801017: Changes 'Open all' bookmarks to not recurse through nested folders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update hasBookmarks Created 9 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bookmark_manager/main.html
diff --git a/chrome/browser/resources/bookmark_manager/main.html b/chrome/browser/resources/bookmark_manager/main.html
index 06d966731b249fd94be48bdaadb3ed436bb337ef..b51601c5cc854bba042f6645c78cb0cf12e251f5 100644
--- a/chrome/browser/resources/bookmark_manager/main.html
+++ b/chrome/browser/resources/bookmark_manager/main.html
@@ -1071,9 +1071,8 @@ function updateOpenCommands(e, command) {
var multiple = selectionCount != 1 || isFolder;
function hasBookmarks(node) {
- var it = new bmm.TreeIterator(node);
- while (it.moveNext()) {
- if (!bmm.isFolder(it.current))
+ for (var i = 0; i < node.children.length; ++i) {
arv (Not doing code reviews) 2011/04/06 21:34:24 i++ in js
+ if (!bmm.isFolder(node.children[i]))
return true;
}
return false;
@@ -1448,13 +1447,15 @@ function openBookmarks(kind) {
var urls = [];
- // Adds the node and all the descendants
+ // Adds the node and all its children.
function addNodes(node) {
- var it = new bmm.TreeIterator(node);
- while (it.moveNext()) {
- var n = it.current;
- if (!bmm.isFolder(n))
- urls.push(n.url);
+ if (node.children) {
+ node.children.forEach(function(child) {
+ if (!bmm.isFolder(child))
+ urls.push(child.url);
+ });
+ } else {
+ urls.push(node.url);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698