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

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

Issue 943643002: Pull up get{User,}BookmarkId from ChromeTab to Tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indent Created 5 years, 10 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/tab_android.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/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index 41cc26fe93f93035d2e191988e86b48349958921..0ca6a7326c03caba84b56109116032fa87e7da60 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -2361,6 +2361,22 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
}
/**
+ * @return The ID of the bookmark associated with the current URL (or -1 if no such bookmark
+ * exists).
+ */
+ public long getBookmarkId() {
+ return isFrozen() ? -1 : nativeGetBookmarkId(mNativeTabAndroid, false);
+ }
+
+ /**
+ * Same as getBookmarkId() but never returns ids for managed bookmarks, or any other bookmarks
+ * that can't be edited by the user.
+ */
+ public long getUserBookmarkId() {
+ return isFrozen() ? -1 : nativeGetBookmarkId(mNativeTabAndroid, true);
+ }
+
+ /**
* Request that this tab receive focus. Currently, this function requests focus for the main
* View (usually a ContentView).
*/
@@ -2482,6 +2498,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
private native void nativeUpdateTopControlsState(
long nativeTabAndroid, int constraints, int current, boolean animate);
private native void nativeSearchByImageInNewTabAsync(long nativeTabAndroid);
+ private native long nativeGetBookmarkId(long nativeTabAndroid, boolean onlyEditable);
private native void nativeSetInterceptNavigationDelegate(long nativeTabAndroid,
InterceptNavigationDelegate delegate);
private native void nativeAttachToTabContentManager(long nativeTabAndroid,
« no previous file with comments | « no previous file | chrome/browser/android/tab_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698