Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java |
| index c65885e46b5e83f9b0ad66dc81dd60ec13b3a17f..c02f0c4624a83bbab8f949026ebd4cf862b6d4a0 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java |
| @@ -26,7 +26,7 @@ import org.chromium.ui.base.PageTransition; |
| import java.net.URI; |
| import java.util.Locale; |
| -import java.util.Random; |
| +import java.util.UUID; |
| /** |
| * A default {@link ContextMenuItemDelegate} that supports the context menu functionality in Tab. |
| @@ -170,9 +170,9 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate { |
| @Override |
| public void onSavePageLater(String linkUrl) { |
| OfflinePageBridge bridge = OfflinePageBridge.getForProfile(mTab.getProfile()); |
| - Random random = new Random(); |
| - long offline_id = random.nextLong(); |
| - ClientId clientId = new ClientId("async_loading", Long.toString(offline_id)); |
| + // Download UI needs "async_loading" namespace and a type 4 (random) GUID. |
|
chili
2016/07/27 18:40:47
nit: can we leave out the 'type 4' in the comments
Dmitry Titov
2016/07/27 19:50:49
Done.
|
| + String uuid = UUID.randomUUID().toString(); |
| + ClientId clientId = new ClientId("async_loading", uuid); |
| bridge.savePageLater(linkUrl, clientId); |
| } |