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,
}
web::URLVerificationTrustLevel 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
// AutofillManager for suggestions.
......
......@@ -29,7 +29,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
__gCrWeb['findPasswordForms'] = function() {
var formDataList = [];
if (hasPasswordField_(window)) {
__gCrWeb.getPasswordFormDataList(formDataList, window);
getPasswordFormDataList_(formDataList, window);
}
return __gCrWeb.stringify(formDataList);
};
......@@ -257,7 +257,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
* @param {Window} win A window (or frame) in which the function should
* look for password forms.
*/
__gCrWeb.getPasswordFormDataList = function(formDataList, win) {
var getPasswordFormDataList_ = function(formDataList, win) {
var doc = win.document;
var forms = doc.forms;
for (var i = 0; i < forms.length; i++) {
......@@ -271,7 +271,7 @@ if (__gCrWeb && !__gCrWeb['fillPasswordForm']) {
// Recursively invoke for all iframes.
var frames = getSameOriginFrames_(win);
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']) {
var passwords = [];
var firstPasswordIndex = 0;
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];
fields.push({
......
......@@ -14,8 +14,8 @@ goog.require('__crWeb.message');
/** Beginning of anonymous object */
(function() {
// Skip iframes that have the same origin as the main frame. For such frames
// no form related actions (eg. filling, saving) are supported.
// Skip iframes that have different origins from the main frame. For such
// frames no form related actions (eg. filling, saving) are supported.
try {
// The following line generates exception for iframes that have different
// 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