Commit 851424e7 authored by Vadym Doroshenko's avatar Vadym Doroshenko Committed by Commit Bot

Small IOS Password Manager clean-ups.

This CL contains the following tiny clean-ups:
1.Removing checking trustLevel in AutofillAgent, which according to comment
https://chromium-review.googlesource.com/c/chromium/src/+/826476/5/components/autofill/ios/browser/autofill_agent.mm#571
is not useful anymore.
2.Making function getPasswordFormDataList to be private. It's not called
outside of password_controller.js
3.Removing a todo comment in getPasswordFormData, which doesn't have much sense now
(even on other platforms PasswordManager doesn't do anything like that).
4.Fixing comment in form.js


Bug: 782224
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ifda40db4c15b8768282f02d36e2463bf9cf58e54
Reviewed-on: https://chromium-review.googlesource.com/827939Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524505}
parent 4b417bde
...@@ -574,11 +574,6 @@ void GetFormAndField(autofill::FormData* form, ...@@ -574,11 +574,6 @@ void GetFormAndField(autofill::FormData* form,
} }
web::URLVerificationTrustLevel trustLevel; web::URLVerificationTrustLevel trustLevel;
const GURL pageURL(webState->GetCurrentURL(&trustLevel)); const GURL pageURL(webState->GetCurrentURL(&trustLevel));
if (trustLevel != web::URLVerificationTrustLevel::kAbsolute) {
DLOG(WARNING) << "Suggestions not offered on untrusted page";
completion(NO);
return;
}
// Once the active form and field are extracted, send a query to the // Once the active form and field are extracted, send a query to the
// AutofillManager for suggestions. // AutofillManager for suggestions.
......
...@@ -29,7 +29,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) { ...@@ -29,7 +29,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
__gCrWeb['findPasswordForms'] = function() { __gCrWeb['findPasswordForms'] = function() {
var formDataList = []; var formDataList = [];
if (hasPasswordField_(window)) { if (hasPasswordField_(window)) {
__gCrWeb.getPasswordFormDataList(formDataList, window); getPasswordFormDataList_(formDataList, window);
} }
return __gCrWeb.stringify(formDataList); return __gCrWeb.stringify(formDataList);
}; };
...@@ -257,7 +257,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) { ...@@ -257,7 +257,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
* @param {Window} win A window (or frame) in which the function should * @param {Window} win A window (or frame) in which the function should
* look for password forms. * look for password forms.
*/ */
__gCrWeb.getPasswordFormDataList = function(formDataList, win) { var getPasswordFormDataList_ = function(formDataList, win) {
var doc = win.document; var doc = win.document;
var forms = doc.forms; var forms = doc.forms;
for (var i = 0; i < forms.length; i++) { for (var i = 0; i < forms.length; i++) {
...@@ -271,7 +271,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) { ...@@ -271,7 +271,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
// Recursively invoke for all iframes. // Recursively invoke for all iframes.
var frames = getSameOriginFrames_(win); var frames = getSameOriginFrames_(win);
for (var i = 0; i < frames.length; i++) { for (var i = 0; i < frames.length; i++) {
__gCrWeb.getPasswordFormDataList(formDataList, frames[i]); getPasswordFormDataList_(formDataList, frames[i]);
} }
}; };
...@@ -287,10 +287,6 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) { ...@@ -287,10 +287,6 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
var passwords = []; var passwords = [];
var firstPasswordIndex = 0; var firstPasswordIndex = 0;
for (var j = 0; j < inputs.length; j++) { for (var j = 0; j < inputs.length; j++) {
// TODO(dplotnikov): figure out a way to identify the activated
// submit, which is the button that the user has already hit
// before this code is called.
var input = inputs[j]; var input = inputs[j];
fields.push({ fields.push({
......
...@@ -14,8 +14,8 @@ goog.require('__crWeb.message'); ...@@ -14,8 +14,8 @@ goog.require('__crWeb.message');
/** Beginning of anonymous object */ /** Beginning of anonymous object */
(function() { (function() {
// Skip iframes that have the same origin as the main frame. For such frames // Skip iframes that have different origins from the main frame. For such
// no form related actions (eg. filling, saving) are supported. // frames no form related actions (eg. filling, saving) are supported.
try { try {
// The following line generates exception for iframes that have different // The following line generates exception for iframes that have different
// origin that. // origin that.
......
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