Bug 1234967 - Post: Explain in which circumstances URLS can uniquely identify a bookmark draft
authorAndrzej Hunt <andrzej@ahunt.org>
Tue, 29 Mar 2016 14:21:33 -0700
changeset 450193 a917d0bb164769d33bafe7a3039d8a881064ed37
parent 450176 e9cab14d0b4b318e1c1789a4c000fe8704319c85
child 539687 d8d49ef774535c87ffade4064d9d51aba2c19ead
push id38783
push userbmo:twointofive@gmail.com
push dateFri, 16 Dec 2016 03:40:42 +0000
bugs1234967
milestone53.0a1
Bug 1234967 - Post: Explain in which circumstances URLS can uniquely identify a bookmark Rebased by Tom Klein. MozReview-Commit-ID: 4ToKmASvwmS
mobile/android/base/java/org/mozilla/gecko/delegates/BookmarkStateChangeDelegate.java
--- 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();