| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
|
| index 74073f24b852310b800db13edc4d8689c80b3f56..c4187256442e535276f7a8ba6437c4bdfb230d1e 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
|
| @@ -135,6 +135,22 @@ public class OfflinePageUtils {
|
| }
|
|
|
| /**
|
| + * Strips scheme from the original URL of the offline page. This is meant to be used by UI.
|
| + * @param onlineUrl an online URL to from which the scheme is removed
|
| + * @return onlineUrl without the scheme
|
| + */
|
| + public static String stripSchemeFromOnlineUrl(String onlineUrl) {
|
| + // Offline pages are only saved for https:// and http:// schemes.
|
| + if (onlineUrl.startsWith("https://")) {
|
| + return onlineUrl.substring(8);
|
| + } else if (onlineUrl.startsWith("http://")) {
|
| + return onlineUrl.substring(7);
|
| + } else {
|
| + return onlineUrl;
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Shows the snackbar for the current tab to provide offline specific information if needed.
|
| * @param activity The activity owning the tab.
|
| * @param tab The current tab.
|
|
|