Index: ios/chrome/browser/passwords/password_controller.mm |
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm |
index 1938757d5af90ad507bb7f9f11041de8b2e5c704..b62751e6912dc48185e64ceef3f0e003e9b49350 100644 |
--- a/ios/chrome/browser/passwords/password_controller.mm |
+++ b/ios/chrome/browser/passwords/password_controller.mm |
@@ -339,13 +339,19 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) { |
if (!GetPageURLAndCheckTrustLevel(webState, &pageURL)) |
return; |
- if (!web::UrlHasWebScheme(pageURL) || !webState->ContentIsHTML()) |
+ if (!web::UrlHasWebScheme(pageURL)) |
return; |
// Notify the password manager that the page loaded so it can clear its own |
// per-page state. |
passwordManager_->DidNavigateMainFrame(); |
+ if (!webState->ContentIsHTML()) { |
+ // If the current page is not HTML, it does not contain any HTML forms. |
+ [self |
+ didFinishPasswordFormExtraction:std::vector<autofill::PasswordForm>()]; |
+ } |
+ |
// Read all password forms from the page and send them to the password |
// manager. |
base::WeakNSObject<PasswordController> weakSelf(self); |