Commit 6e1da53a authored by Livvie Lin's avatar Livvie Lin Committed by Commit Bot

[iOS] Only GoBack if CanGoBack on committed interstitials

Check whether it's possible to go back before trying to perform a
back navigation on a committed interstitial when the "Back to safety"
button is pressed. This CL fixes the stability issue--a follow-up CL
will fix the actual functionality of the button on e.g. interstitial
opened in new tab.

Bug: 1059142
Change-Id: Icc03af381ca376731b451238ccb671a216764bfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111411Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751881}
parent 6f43b80d
...@@ -41,7 +41,9 @@ void IOSChromeControllerClient::LaunchDateAndTimeSettings() { ...@@ -41,7 +41,9 @@ void IOSChromeControllerClient::LaunchDateAndTimeSettings() {
} }
void IOSChromeControllerClient::GoBack() { void IOSChromeControllerClient::GoBack() {
web_state_->GetNavigationManager()->GoBack(); if (CanGoBack()) {
web_state_->GetNavigationManager()->GoBack();
}
} }
bool IOSChromeControllerClient::CanGoBack() { bool IOSChromeControllerClient::CanGoBack() {
......
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