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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/bmm.js

Issue 10966025: Change bookmarkManager API from experimental to private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bookmarkManager->bookmarkManagerPrivate Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('bmm', function() { 5 cr.define('bmm', function() {
6 const Promise = cr.Promise; 6 const Promise = cr.Promise;
7 7
8 /** 8 /**
9 * Whether a node contains another node. 9 * Whether a node contains another node.
10 * @param {!BookmarkTreeNode} parent 10 * @param {!BookmarkTreeNode} parent
(...skipping 23 matching lines...) Expand all
34 /** 34 /**
35 * Loads a subtree of the bookmark tree and returns a {@code cr.Promise} that 35 * Loads a subtree of the bookmark tree and returns a {@code cr.Promise} that
36 * will be fulfilled when done. This reuses multiple loads so that we do not 36 * will be fulfilled when done. This reuses multiple loads so that we do not
37 * load the same subtree more than once at the same time. 37 * load the same subtree more than once at the same time.
38 * @return {!cr.Promise} The future promise for the load. 38 * @return {!cr.Promise} The future promise for the load.
39 */ 39 */
40 function loadSubtree(id) { 40 function loadSubtree(id) {
41 var p = new Promise; 41 var p = new Promise;
42 if (!(id in loadingPromises)) { 42 if (!(id in loadingPromises)) {
43 loadingPromises[id] = new Promise; 43 loadingPromises[id] = new Promise;
44 chrome.experimental.bookmarkManager.getSubtree(id, false, 44 chrome.bookmarkManagerPrivate.getSubtree(id, false, function(nodes) {
45 function(nodes) {
46 loadingPromises[id].value = nodes && nodes[0]; 45 loadingPromises[id].value = nodes && nodes[0];
47 delete loadingPromises[id]; 46 delete loadingPromises[id];
48 }); 47 });
49 } 48 }
50 loadingPromises[id].addListener(function(n) { 49 loadingPromises[id].addListener(function(n) {
51 p.value = n; 50 p.value = n;
52 }); 51 });
53 return p; 52 return p;
54 } 53 }
55 54
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 }; 221 };
223 222
224 return { 223 return {
225 contains: contains, 224 contains: contains,
226 isFolder: isFolder, 225 isFolder: isFolder,
227 loadSubtree: loadSubtree, 226 loadSubtree: loadSubtree,
228 loadTree: loadTree, 227 loadTree: loadTree,
229 addBookmarkModelListeners: addBookmarkModelListeners 228 addBookmarkModelListeners: addBookmarkModelListeners
230 }; 229 };
231 }); 230 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698