Bug 1234967 - Post: Explain in which circumstances URLS can uniquely identify a bookmark
Rebased by Tom Klein.
MozReview-Commit-ID: 4ToKmASvwmS
--- a/mobile/android/base/java/org/mozilla/gecko/delegates/BookmarkStateChangeDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/delegates/BookmarkStateChangeDelegate.java
@@ -172,16 +172,20 @@ public class BookmarkStateChangeDelegate
public void onPromptFinished(final GeckoBundle result) {
final int itemId = result.getInt("button", -1);
if (itemId == 0) {
final String extrasId = res.getResourceEntryName(R.string.contextmenu_edit_bookmark);
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION,
TelemetryContract.Method.DIALOG, extrasId);
+ // In this case we're allowed to use the bookmark URL (as opposed to id). We
+ // know the URL uniquely identifies the bookmark as it's just been created (the
+ // UI only lets us create a new bookmark if a given URL isn't bookmarked
+ // anywhere).
new EditBookmarkDialog(browserApp).show(tab.getURL());
} else if (itemId == 1) {
final String extrasId = res.getResourceEntryName(R.string.contextmenu_add_to_launcher);
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION,
TelemetryContract.Method.DIALOG, extrasId);
final String url = tab.getURL();