| 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 d46b3a9168eb6b8ec64043f9aa6c16f70348b9ce..9fbede7db21ecd7a6d392380e3435dac80f1227c 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
|
| @@ -139,6 +139,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.
|
|
|