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

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

Issue 2541123005: Revert of [NTP] Do not force offline version when opening non-download snippets. (Closed)
Patch Set: 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 7a36b089a05ef77fa3c2a6028f70466038dfb815..eda72050881735c7724025299c753b1f95522a7e 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,14 +379,10 @@
}
LoadUrlParams loadUrlParams;
- // 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.mIsAssetDownload) {
- assert article.getOfflinePageOfflineId() != null;
- assert windowOpenDisposition == WindowOpenDisposition.CURRENT_TAB
- || windowOpenDisposition == WindowOpenDisposition.NEW_WINDOW
- || windowOpenDisposition == WindowOpenDisposition.NEW_FOREGROUND_TAB;
+ // 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) {
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