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

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: i++ 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 | « chrome/browser/resources/bookmark_manager/js/bmm/tree_iterator_test.html ('k') | 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..21666e7ce15f4fd929629593447b5c4f660f65f2 100644
--- a/chrome/browser/resources/bookmark_manager/main.html
+++ b/chrome/browser/resources/bookmark_manager/main.html
@@ -44,7 +44,6 @@ found in the LICENSE file.
<script src="chrome://resources/js/local_strings.js"></script>
<script src="chrome://resources/js/i18n_template.js"></script>
-<script src="js/bmm/tree_iterator.js"></script>
<script src="js/bmm.js"></script>
<script src="js/bmm/bookmark_list.js"></script>
<script src="js/bmm/bookmark_tree.js"></script>
@@ -1071,9 +1070,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++) {
+ if (!bmm.isFolder(node.children[i]))
return true;
}
return false;
@@ -1448,13 +1446,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 | « chrome/browser/resources/bookmark_manager/js/bmm/tree_iterator_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698