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

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

Issue 685953002: Add JNI bridges for EnhancedBookmark Create/AddFolder/Move (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/EnhancedBookmarksBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java
index 20b930a6a5da660478b1ee618c7efe7bdb5e3c68..c0fa6d7be2cf7caa7c21cacd547d1ed4979b4ee0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java
@@ -44,6 +44,39 @@ public final class EnhancedBookmarksBridge {
mNativeEnhancedBookmarksBridge = 0;
}
+ /**
+ * Adds a folder to the EnhancedBookmarkModel
+ * @param parent The parent of this folder
+ * @param index The position this folder should appear within the parent
+ * @param title The title of the bookmark
+ * @return The ID of the newly created folder.
+ */
+ public BookmarkId addFolder(BookmarkId parent, int index, String title) {
+ return nativeAddFolder(mNativeEnhancedBookmarksBridge, parent, index, title);
+ }
+
+ /**
+ * Adds a Bookmark to the EnhancedBookmarkModel
+ * @param parent The parent of this bookmark
+ * @param index The position this bookmark should appear within the parent
+ * @param title The title of the bookmark
+ * @param url URL of the bookmark
+ * @return The ID of the newly created bookmark
+ */
+ public BookmarkId addBookmark(BookmarkId parent, int index, String title, String url) {
+ return nativeAddBookmark(mNativeEnhancedBookmarksBridge, parent, index, title, url);
+ }
+
+ /**
+ * Moves a Bookmark in the EnhancedBookmarkModel
+ * @param bookmarkId The item to be be moved
+ * @param newParentId The new parent of the item
+ * @param index New position index of bookmark within the parent
+ */
+ public void moveBookmark(BookmarkId bookmarkId, BookmarkId newParentId, int index) {
+ nativeMoveBookmark(mNativeEnhancedBookmarksBridge, bookmarkId, newParentId, index);
+ }
+
public String getBookmarkDescription(BookmarkId id) {
return nativeGetBookmarkDescription(mNativeEnhancedBookmarksBridge, id.getId(),
id.getType());
@@ -111,4 +144,11 @@ public final class EnhancedBookmarksBridge {
private native void nativeGetBookmarksForFilter(long nativeEnhancedBookmarksBridge,
String filter, List<BookmarkId> list);
private native String[] nativeGetFilters(long nativeEnhancedBookmarksBridge);
+ private native BookmarkId nativeAddFolder(long nativeEnhancedBookmarksBridge, BookmarkId parent,
+ int index, String title);
+ private native void nativeMoveBookmark(long nativeEnhancedBookmarksBridge,
+ BookmarkId bookmarkId, BookmarkId newParentId, int index);
+ private native BookmarkId nativeAddBookmark(long nativeEnhancedBookmarksBridge,
+ BookmarkId parent, int index, String title, String url);
+
}

Powered by Google App Engine
This is Rietveld 408576698