PasswordFormManager::DoesManage returns a bitmask
Currently, PasswordFormManager::DoesManage returns a Boolean indicating whether the form observed by the manager matches the form passed as an argument. Optionally, one can specify, whether the match should include action URLs or not.
This leads to duplicate calls in PasswordManager::ProvisionallySavePassword (where an exact match is tried first, and then retried without action matching). It could also make calling DoesManage cumbersome if we find out we need more match relaxations (work on handling autocomplete attributes indicates that we might).
This CL changes the signature of DoesManage, so that it returns the scope in which both forms matched as a bitmask. That will solve the duplicate calls (call once, inspect result twice), and will make adding new optional matching parameters easier.
Apart from the refactoring, this CL also fixes two issues:
(1) Previously, |DoesManage(form)| reported that |form| matches |observed_form_| when |form| was not a HTML form, and shared the signon realm with |observed_form_|. In particular, such |form| would match |observed_form_|, even if |observed_form_| was a HTML form.
This CL requires that form schemes are equal for the base match, and adds a test for that.
(2) Previously, the comments said that an empty action URL matches any other action URL, but the code checked URL invalidity instead of emptiness.
This CL checks for emptiness, to match the comment.
BUG=390468
Review URL: https://codereview.chromium.org/
359413009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281267 0039d316-1c4b-4281-b951-d872f2087c98