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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2553663002: [NTP] Do not force offline version when opening non-download snippets. (Closed)
Patch Set: merge fix Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index eda72050881735c7724025299c753b1f95522a7e..d6a41966c38a3c83c2a61cb29db89744c1a0f591 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -379,10 +379,14 @@ public class NewTabPage
}
LoadUrlParams loadUrlParams;
- // The snippet's offline page is ignored if the snippet is saved or opened in incognito.
- if (article.getOfflinePageOfflineId() != null
- && windowOpenDisposition != WindowOpenDisposition.SAVE_TO_DISK
- && windowOpenDisposition != WindowOpenDisposition.OFF_THE_RECORD) {
+ // We explicitly open an offline page only for offline page downloads. For all other
+ // sections the URL is opened and it is up to Offline Pages whether to open its offline
+ // page (e.g. when offline).
+ if (article.isDownload() && !article.mIsDownloadedAsset) {
+ assert article.getOfflinePageOfflineId() != null;
+ assert windowOpenDisposition == WindowOpenDisposition.CURRENT_TAB
+ || windowOpenDisposition == WindowOpenDisposition.NEW_WINDOW
+ || windowOpenDisposition == WindowOpenDisposition.NEW_FOREGROUND_TAB;
loadUrlParams = OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion(
article.mUrl, article.getOfflinePageOfflineId());
// Extra headers are not read in loadUrl, but verbatim headers are.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698