diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:22:15 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:22:15 +0000 |
commit | 9a30588cd1081b702ade98be4eb4a7c1344bb43e (patch) | |
tree | 7b2d1b7eae4ea9c6f4117a2a5d20590ec6e9cf33 /chrome/browser/resources/bookmark_manager/js/bmm.js | |
parent | 5e90f82f1121ec44022d60f3645c8105cc8a6271 (diff) | |
download | chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.zip chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.tar.gz chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.tar.bz2 |
Move bookmark manager
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/560023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/bookmark_manager/js/bmm.js')
-rw-r--r-- | chrome/browser/resources/bookmark_manager/js/bmm.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/resources/bookmark_manager/js/bmm.js b/chrome/browser/resources/bookmark_manager/js/bmm.js new file mode 100644 index 0000000..24c4ad0 --- /dev/null +++ b/chrome/browser/resources/bookmark_manager/js/bmm.js @@ -0,0 +1,24 @@ +// Copyright (c) 2010 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. + +cr.define('bmm', function() { + function isFolder(bookmarkNode) { + return !bookmarkNode.url; + } + + function contains(parent, descendant) { + if (descendant.parentId == parent.id) + return true; + // the bmm.treeLookup contains all folders + var parentTreeItem = bmm.treeLookup[descendant.parentId]; + if (!parentTreeItem || !parentTreeItem.bookmarkNode) + return false; + return this.contains(parent, parentTreeItem.bookmarkNode); + } + + return { + isFolder: isFolder, + contains: contains + }; +}); |