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

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

Issue 2202423004: [Offline Page]Enable share offline page from online tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newBranchOnTryout
Patch Set: Patch to land Created 4 years, 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java
index dbddbae2d21e8ef85c7868ec4fd677d40ca1c570..72f8380eaa94047f9d56cf3174aacd14ed8c6b7a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java
@@ -6,6 +6,8 @@ package org.chromium.chrome.browser.offlinepages;
import org.chromium.components.bookmarks.BookmarkId;
+import java.util.UUID;
+
/**
* Object to hold a client identifier for an offline page.
*/
@@ -49,4 +51,14 @@ public class ClientId {
if (id == null) return null;
return new ClientId(OfflinePageBridge.BOOKMARK_NAMESPACE, id.toString());
}
+
+ /**
+ * Create a client id for a tab when its contents need to be saved for sharing purposes.
+ * @param id The tab id to wrap.
+ * @return A {@link ClientId} that represents this TabId.
+ */
+ public static ClientId createClientIdForTabSharing() {
+ String uuid = UUID.randomUUID().toString();
+ return new ClientId(OfflinePageBridge.SHARE_NAMESPACE, uuid);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698