Commit 3829283e authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Fix bug on open downloaded articles in incognito.

Currently opening downloaded articles and most visited website does not
work, since OfflinePageUtils returns null for given off-the-record
profile. This CL fix the bug by passing always regular profile to
OfflinePageUtil. It is safe, since offline page download is only
available for regular mode.

Bug: 1093758
Change-Id: Id542113e2d5676541766fbd2a2770e954c0b24a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299233Reviewed-by: default avatarRamin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarCarlos Knippschild <carlosk@chromium.org>
Reviewed-by: default avatarJian Li <jianli@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795496}
parent 560afba7
......@@ -89,8 +89,6 @@ public class OfflinePageDownloadBridge {
@CalledByNative
private static void openItem(final String url, final long offlineId, final int location,
final boolean isIncognito, final boolean openInCct) {
Profile profile = isIncognito ? Profile.getLastUsedRegularProfile().getPrimaryOTRProfile()
: Profile.getLastUsedRegularProfile();
OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion(
url, offlineId, location, (params) -> {
if (params == null) return;
......@@ -104,7 +102,7 @@ public class OfflinePageDownloadBridge {
} else {
openItemInNewTab(offlineId, params, isIncognito);
}
}, profile);
}, Profile.getLastUsedRegularProfile());
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment