Skip to content
Snippets Groups Projects
Commit dd149895 authored by Min Qin's avatar Min Qin Committed by Chromium LUCI CQ
Browse files

[M131] Fix an issue that a null callback is passed when hitting

back/forward button on PDF

the callback is moved, so changing the code order to avoid using a null cb

(cherry picked from commit 6567bbee)

Low-Coverage-Reason: TRIVIAL_CHANGE
Bug: 377301543
Change-Id: I296466d6873e7f2edf9746717585273670e0ce5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5988331


Reviewed-by: default avatarShu Yang <shuyng@google.com>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1377757}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5989723


Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Shu Yang <shuyng@google.com>
Cr-Commit-Position: refs/branch-heads/6778@{#1725}
Cr-Branched-From: b21671ca-refs/heads/main@{#1368529}
parent 27099e90
No related branches found
No related tags found
No related merge requests found
......@@ -2021,9 +2021,6 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
return;
}
CanDownloadCallback cb = base::BindOnce(
&ChromeDownloadManagerDelegate::OnCheckDownloadAllowedComplete,
weak_ptr_factory_.GetWeakPtr(), std::move(check_download_allowed_cb));
#if BUILDFLAG(IS_ANDROID)
if (ShouldOpenPdfInline() && mime_type == pdf::kPDFMimeType) {
// If this is a forward/back navigation, the native page should trigger a
......@@ -2036,6 +2033,13 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
}
NewNavigationObserver::GetInstance()->StartObserving(web_contents);
}
#endif
CanDownloadCallback cb = base::BindOnce(
&ChromeDownloadManagerDelegate::OnCheckDownloadAllowedComplete,
weak_ptr_factory_.GetWeakPtr(), std::move(check_download_allowed_cb));
#if BUILDFLAG(IS_ANDROID)
DownloadControllerBase::Get()->AcquireFileAccessPermission(
web_contents_getter,
base::BindOnce(&OnDownloadAcquireFileAccessPermissionDone,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment