diff options
author | vabr <vabr@chromium.org> | 2016-03-18 06:21:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-18 13:22:05 +0000 |
commit | a0903eb6c26873d6d5e37ff0507dd695d54e25d3 (patch) | |
tree | 477e1f190fe0cff0a1bc11ec50e980531c5195ca /ios | |
parent | 8e34fbee0755ce47548153ef4fec89d754e78f4a (diff) | |
download | chromium_src-a0903eb6c26873d6d5e37ff0507dd695d54e25d3.zip chromium_src-a0903eb6c26873d6d5e37ff0507dd695d54e25d3.tar.gz chromium_src-a0903eb6c26873d6d5e37ff0507dd695d54e25d3.tar.bz2 |
Password manager on iOS should understand non-HTML landing pages
Currently, password manager on iOS ignores all pages which are not HTML.
However, if a password form has a, e.g., text/plain landing page, this will
prevent password manager from saving a password on that form. This is
different from the desktop & Android behaviour.
This CL changes password manager on iOS, so that it considers all types of
landing pages, but unless these are HTML, does not try to find password forms
on them.
The test for the changed code is still downstream, and hence not in this CL.
BUG=595717
Review URL: https://codereview.chromium.org/1806333005
Cr-Commit-Position: refs/heads/master@{#381949}
Diffstat (limited to 'ios')
-rw-r--r-- | ios/chrome/browser/passwords/password_controller.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm index 1938757..b62751e 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); |