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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java

Issue 506353003: [Enhanced Bookmark] Add GetAllFoldersWithDepth in bookmark bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GetMobileFolderId in bridge Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java
index b5d51e0098a91c95528c0e258eb53ef4564c6385..99592df8bddfefa857acc7b5c201b29ca9e22450 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java
@@ -204,6 +204,32 @@ public class BookmarksBridge {
}
/**
+ * Populates folderList with BookmarkIds of folders user can move bookmarks
newt (away) 2014/09/04 21:49:55 s/user/that users
Ian Wen 2014/09/05 01:00:18 Done.
+ * to and folderList with corresponding integer as depths.
newt (away) 2014/09/04 21:49:55 I'd explain the depths a bit more. In particular,
Ian Wen 2014/09/05 01:00:19 Done.
+ *
+ * All sub-folders of "mobile" and "other" will be in the result list.
+ * However "desktop" will be placed among those sub-folders. This is different
+ * than the original hierarchy in bookmark model.
+ *
+ * The result list will be sorted alphabetically by title. Note root node,
+ * managed folder, partner folder are NOT included.
+ */
+ public void getAllFoldersWithDepth(List<BookmarkId> folderList,
+ List<Integer> depthList) {
+ assert mIsNativeBookmarkModelLoaded;
+ nativeGetAllFoldersWithDepth(mNativeBookmarksBridge, folderList, depthList);
+ }
+
+ /**
+ * @return The BookmarkId for Mobile folder node
+ */
+ public BookmarkId getMobileFolderId() {
+ assert mIsNativeBookmarkModelLoaded;
+ return nativeGetMobileFolderId(mNativeBookmarksBridge);
+ }
+
+
+ /**
* Reads sub-folder IDs, sub-bookmark IDs, or both of the given folder.
*
* @param getFolders Whether sub-folders should be returned.
@@ -430,6 +456,13 @@ public class BookmarksBridge {
}
@CalledByNative
+ private static void addToBookmarkIdListWithDepth(List<BookmarkId> folderList, long id,
+ int type, List<Integer> depthList, int depth) {
+ folderList.add(new BookmarkId(id, type));
+ depthList.add(depth);
+ }
+
+ @CalledByNative
private static BookmarkId createBookmarkId(long id, int type) {
return new BookmarkId(id, type);
}
@@ -442,6 +475,9 @@ public class BookmarksBridge {
List<BookmarkId> bookmarksList);
private native void nativeGetTopLevelFolderIDs(long nativeBookmarksBridge, boolean getSpecial,
boolean getNormal, List<BookmarkId> bookmarksList);
+ private native void nativeGetAllFoldersWithDepth(long nativeBookmarksBridge,
+ List<BookmarkId> folderList, List<Integer> depthList);
+ private native BookmarkId nativeGetMobileFolderId(long nativeBookmarksBridge);
private native void nativeGetChildIDs(long nativeBookmarksBridge, long id, int type,
boolean getFolders, boolean getBookmarks, List<BookmarkId> bookmarksList);
private native void nativeGetAllBookmarkIDsOrderedByCreationDate(long nativeBookmarksBridge,

Powered by Google App Engine
This is Rietveld 408576698