Index: chrome/test/data/extensions/bookmarks/bookmark_api.html |
diff --git a/chrome/test/data/extensions/bookmarks/bookmark_api.html b/chrome/test/data/extensions/bookmarks/bookmark_api.html |
deleted file mode 100644 |
index 4217ece3722295e41508d66a590a7e0b0738689c..0000000000000000000000000000000000000000 |
--- a/chrome/test/data/extensions/bookmarks/bookmark_api.html |
+++ /dev/null |
@@ -1,90 +0,0 @@ |
-<html> |
-<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css"> |
-<script> |
-var dump = function(obj, indent) { |
- if (indent === undefined) |
- indent = ""; |
- if (typeof obj == "object") { |
- var ret = "{<br/>"; |
- var child_indent = indent + " "; |
- for (var item in obj) { |
- var child = null; |
- try { |
- child = obj[item]; |
- } catch (e) { |
- child = '<error>'; |
- } |
- ret += child_indent + item + ": " + dump(child, indent + " "); |
- } |
- return ret + indent + "}" + "<br/>"; |
- } else { |
- return obj.toString() + "<br/>"; |
- } |
-} |
- |
-var testMoveBookmarks = function(event) { |
- testMoveBookmarks2(event); |
-} |
- |
-var testMoveBookmarks2 = function(event) { |
- console.log(testMoveBookmarks2.caller.name); |
- if (event.shiftKey) { |
- // TODO - it would be nice to have a mechanism to do this built-in to a |
- // context menu. |
- window.location.reload(); |
- return; |
- } |
- console.log("testMoveBookmarks2"); |
- chromium.bookmarks.get([], function(root) { |
- console.log("1"); |
- chromium.bookmarks.get(root[0].childrenIds, function(root_children) { |
- var bookmark_bar = root_children[0]; // bookmarks bar is always first |
- chromium.bookmarks.get(bookmark_bar.childrenIds, |
- function(bar_children) { |
- var folder_search = []; |
- bar_children.forEach(function(child) { |
- if (child.title == "folder" && child.url == undefined) { |
- folder_search.push(child); |
- } |
- }); |
- if (folder_search.length == 1) { |
- console.log('moving children out of "folder"'); |
- var folder = folder_search[0]; |
- folder.childrenIds.forEach(function(folder_child_id) { |
- chromium.bookmarks.move({'id': folder_child_id, |
- 'parentId': bookmark_bar.id}); |
- }); |
- chromium.bookmarks.remove({'id': folder.id}); |
- } else if (folder_search.length == 0) { |
- console.log('creating "folder" and moving children into it'); |
- chromium.bookmarks.create({'parentId': bookmark_bar.id, |
- 'title': 'folder'}, |
- function(folder) { |
- chromium.bookmarks.search("oog", function(oog_search) { |
- oog_search.forEach(function(oog_match) { |
- chromium.bookmarks.move({'id': oog_match.id, |
- 'parentId': folder.id}) |
- }); |
- }); |
- }); |
- } else { |
- console.log("my puny code wasn't written to handle this"); |
- } |
- }); |
- }); |
- }); |
-}; |
- |
-var dumpBookmarks = function(event) { |
- window.open("bookmark_view.html"); |
-}; |
-</script> |
-<body> |
-<div class="toolstrip-button" onclick="dumpBookmarks(window.event);"> |
-<span>Dump Bookmarks</span> |
-</div> |
-<div class="toolstrip-button" onclick="testMoveBookmarks(window.event);"> |
-<span>Test Move</span> |
-</div> |
-</body> |
-</html> |