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

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

Issue 694093002: Add method to get filters for a bookmark in Enhanced bookmark bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: solve a partner bookmark case 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
« no previous file with comments | « no previous file | chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 98859f10af178627725cdc0a5c975dfc13153588..e330c48665ed22660fc1051dbde70b9fe4a84d1d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/EnhancedBookmarksBridge.java
@@ -83,17 +83,26 @@ public final class EnhancedBookmarksBridge {
* 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
+ * @param index New position index of bookmark within the parent.
*/
public void moveBookmark(BookmarkId bookmarkId, BookmarkId newParentId, int index) {
nativeMoveBookmark(mNativeEnhancedBookmarksBridge, bookmarkId, newParentId, index);
}
+ /**
+ * Get descriptions of a given bookmark.
+ * @param id The id of the bookmark to look at.
+ * @return Description of the bookmark. If given a partner bookmark, this method will return an
+ * empty list.
+ */
public String getBookmarkDescription(BookmarkId id) {
return nativeGetBookmarkDescription(mNativeEnhancedBookmarksBridge, id.getId(),
id.getType());
}
+ /**
+ * Sets the description of the given bookmark.
+ */
public void setBookmarkDescription(BookmarkId id, String description) {
nativeSetBookmarkDescription(mNativeEnhancedBookmarksBridge, id.getId(), id.getType(),
description);
@@ -163,6 +172,18 @@ public final class EnhancedBookmarksBridge {
}
/**
+ * Get all filters associated with the given bookmark.
+ *
+ * @param bookmark The bookmark to find filters for.
+ * @return Array of Strings, each representing a filter. If given a partner bookmark, this
+ * method will return an empty array.
+ */
+ public String[] getFiltersForBookmark(BookmarkId bookmark) {
+ return nativeGetFiltersForBookmark(mNativeEnhancedBookmarksBridge, bookmark.getId(),
+ bookmark.getType());
+ }
+
+ /**
* @return Current set of known auto-filters for bookmarks.
*/
public List<String> getFilters() {
@@ -206,6 +227,8 @@ public final class EnhancedBookmarksBridge {
private native List<BookmarkId> nativeGetSearchResults(long nativeEnhancedBookmarksBridge,
String query);
private native String[] nativeGetFilters(long nativeEnhancedBookmarksBridge);
+ private native String[] nativeGetFiltersForBookmark(long nativeEnhancedBookmarksBridge, long id,
+ int type);
private native BookmarkId nativeAddFolder(long nativeEnhancedBookmarksBridge, BookmarkId parent,
int index, String title);
private native void nativeMoveBookmark(long nativeEnhancedBookmarksBridge,
« no previous file with comments | « no previous file | chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698