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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 2245733004: Serve offline page for online URL on disconnected or bad networks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.tab; 5 package org.chromium.chrome.browser.tab;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.Application; 8 import android.app.Application;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after
2886 * Shows the list of offline pages. This should only be hit when offline pag es feature is 2886 * Shows the list of offline pages. This should only be hit when offline pag es feature is
2887 * enabled. 2887 * enabled.
2888 */ 2888 */
2889 @CalledByNative 2889 @CalledByNative
2890 public void showOfflinePages() { 2890 public void showOfflinePages() {
2891 // TODO(jianli): This is not currently used. Figure out what to do here. 2891 // TODO(jianli): This is not currently used. Figure out what to do here.
2892 // http://crbug.com/636574 2892 // http://crbug.com/636574
2893 } 2893 }
2894 2894
2895 /** 2895 /**
2896 * @return Original url of the tab, if tab currently displays offline copy, would return url of 2896 * @return Original url of the tab, which is the original url from DOMDistil ler.
2897 * the original page. Otherwise return the original url from DOMDistiller.
2898 */ 2897 */
2899 public String getOriginalUrl() { 2898 public String getOriginalUrl() {
2900 OfflinePageItem offlinePage = getOfflinePage();
2901 if (offlinePage != null) return offlinePage.getUrl();
2902 return DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(getUrl()); 2899 return DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(getUrl());
2903 } 2900 }
2904 2901
2905 /** 2902 /**
2906 * If a Lo-Fi snackbar has not been shown yet for this page load, a Lo-Fi sn ackbar is shown. 2903 * If a Lo-Fi snackbar has not been shown yet for this page load, a Lo-Fi sn ackbar is shown.
2907 * 2904 *
2908 * @param isPreview Whether the Lo-Fi response was a preview response. 2905 * @param isPreview Whether the Lo-Fi response was a preview response.
2909 */ 2906 */
2910 @CalledByNative 2907 @CalledByNative
2911 public void onLoFiResponseReceived(boolean isPreview) { 2908 public void onLoFiResponseReceived(boolean isPreview) {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
3264 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, 3261 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id,
3265 InterceptNavigationDelegate delegate); 3262 InterceptNavigationDelegate delegate);
3266 private native void nativeAttachToTabContentManager(long nativeTabAndroid, 3263 private native void nativeAttachToTabContentManager(long nativeTabAndroid,
3267 TabContentManager tabContentManager); 3264 TabContentManager tabContentManager);
3268 private native void nativeAttachOverlayWebContents( 3265 private native void nativeAttachOverlayWebContents(
3269 long nativeTabAndroid, WebContents webContents, boolean visible); 3266 long nativeTabAndroid, WebContents webContents, boolean visible);
3270 private native void nativeDetachOverlayWebContents( 3267 private native void nativeDetachOverlayWebContents(
3271 long nativeTabAndroid, WebContents webContents); 3268 long nativeTabAndroid, WebContents webContents);
3272 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); 3269 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url);
3273 } 3270 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698