// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Search the bookmarks when entering the search keyword. $(function() { $('#search').change(function() { $('#bookmarks').empty(); dumpBookmarks($('#search').val()); }); }); // Traverse the bookmark tree, and print the folder and nodes. function dumpBookmarks(query) { var bookmarkTreeNodes = chrome.bookmarks.getTree( function(bookmarkTreeNodes) { $('#bookmarks').append(dumpTreeNodes(bookmarkTreeNodes, query)); }); } function dumpTreeNodes(bookmarkNodes, query) { var list = $('