Commit 568d678e authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Deactive non-crw NTP on navigation to an auth error.

Hide the NTP immediately when load an HTTP auth page from the NTP.
|dialogPresenter| should only run when the webState->GetView() is visible.

Bug: 826369
Change-Id: Ic154a4fdd4d52a2ddfec27de3ee80d85dd88cb18
Reviewed-on: https://chromium-review.googlesource.com/c/1323808Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607311}
parent 23ba3a17
...@@ -3605,6 +3605,13 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -3605,6 +3605,13 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
proposedCredential:(NSURLCredential*)proposedCredential proposedCredential:(NSURLCredential*)proposedCredential
completionHandler:(void (^)(NSString* username, completionHandler:(void (^)(NSString* username,
NSString* password))handler { NSString* password))handler {
// Hide the NTP immediately when load an HTTP auth page from the NTP.
// |dialogPresenter| should only run when the webState->GetView() is visible.
NewTabPageTabHelper* NTPHelper = NewTabPageTabHelper::FromWebState(webState);
if (NTPHelper && NTPHelper->IsActive()) {
NTPHelper->Deactivate();
}
[self.dialogPresenter runAuthDialogForProtectionSpace:protectionSpace [self.dialogPresenter runAuthDialogForProtectionSpace:protectionSpace
proposedCredential:proposedCredential proposedCredential:proposedCredential
webState:webState webState:webState
......
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