Commit 4c3be7eb authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

Revert "ios: Block universal links during restore."

This reverts commit 785cd90b.

Reason for revert: Better fix here:
  https://chromium-review.googlesource.com/c/chromium/src/+/2432053

Original change's description:
> ios: Block universal links during restore.
>
> NOTRY=True
> Bug: 1129875, 1132099
>
> Change-Id: I901f4aea4a0df4e33c23c848289acb0aa2561369
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2430290
> Commit-Queue: Justin Cohen <justincohen@chromium.org>
> Reviewed-by: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Ali Juma <ajuma@chromium.org>
> Reviewed-by: Gauthier Ambard <gambard@chromium.org>
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#810720}

TBR=rohitrao@chromium.org,ajuma@chromium.org,justincohen@chromium.org,eugenebut@chromium.org,michaeldo@chromium.org,mrefaat@chromium.org,gambard@chromium.org

Change-Id: I7b48feab29a592af07c8ebf4a1540fe6279bc04e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1129875
Bug: 1132099
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432132Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810763}
parent 8ea41ea2
......@@ -533,11 +533,7 @@ void ReportOutOfSyncURLInDidStartProvisionalNavigation(
return;
}
BOOL isOffTheRecord = self.webStateImpl->GetBrowserState()->IsOffTheRecord();
BOOL isInRestoreSession =
self.webStateImpl->GetNavigationManager()->IsRestoreSessionInProgress();
BOOL isDocURLRestoringSession = IsRestoreSessionUrl(self.documentURL);
decisionHandler(web::GetAllowNavigationActionPolicy(
isOffTheRecord | isInRestoreSession | isDocURLRestoringSession));
decisionHandler(web::GetAllowNavigationActionPolicy(isOffTheRecord));
}
- (void)webView:(WKWebView*)webView
......
......@@ -15,9 +15,8 @@ extern const WKNavigationActionPolicy
kNavigationActionPolicyAllowAndBlockUniversalLinks;
// Returns the WKNavigationActionPolicy for allowing navigations given the
// |block_universal_links| state for the associated WebState.
WKNavigationActionPolicy GetAllowNavigationActionPolicy(
bool block_universal_links);
// |off_the_record| state for the associated BrowserState.
WKNavigationActionPolicy GetAllowNavigationActionPolicy(bool off_the_record);
} // namespace web
......
......@@ -19,17 +19,15 @@ const WKNavigationActionPolicy
static_cast<WKNavigationActionPolicy>(WKNavigationActionPolicyAllow +
2);
WKNavigationActionPolicy GetAllowNavigationActionPolicy(
bool block_universal_links) {
WKNavigationActionPolicy GetAllowNavigationActionPolicy(bool off_the_record) {
// When both the |block_universal_links_in_off_the_record| gn arg and the
// |web::features::kBlockUniversalLinksInOffTheRecordMode| feature flag are
// enabled, the returned value will block opening native applications if
// |block_universal_links| is true to prevent sharing off the record state or
// opening an app unexpectedly during restore.
// |off_the_record| is true to prevent sharing off the record state.
#if BUILDFLAG(BLOCK_UNIVERSAL_LINKS_IN_OFF_THE_RECORD_MODE)
bool block_universal_links_enabled = base::FeatureList::IsEnabled(
web::features::kBlockUniversalLinksInOffTheRecordMode);
if (block_universal_links && block_universal_links_enabled) {
if (off_the_record && block_universal_links_enabled) {
return kNavigationActionPolicyAllowAndBlockUniversalLinks;
}
#endif // BUILDFLAG(BLOCK_UNIVERSAL_LINKS_IN_OFF_THE_RECORD_MODE)
......
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