Commit 722bc273 authored by vabr@chromium.org's avatar vabr@chromium.org

Password manager internals page: Add logging for parsed forms

The PasswordAutofillAgent::SendPasswordForms method is called
both when HTML forms are just parsed, and also when they are rendered.
The former is the moment when the password manager first hears about
forms, and notes their presence not only for autofill, but also
for matching against credentials submitted later.

However, I missed the second use-case (matching submitted credentials)
when I put logging there for the internals page, and so currently
the progress is only logged when the forms are rendered.

This CL should change this: logs are now also sent when the forms have just been parsed.

I already saw issues (e.g., http://crbug.com/367768) where such additional logging would have sped up the investigation.

There are no tests, because we don't which logs are generated when.

BUG=347927

Review URL: https://codereview.chromium.org/323423006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276848 0039d316-1c4b-4281-b951-d872f2087c98
parent a427cd14
......@@ -467,14 +467,10 @@ void PasswordAutofillAgent::FirstUserGestureObserved() {
void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame,
bool only_visible) {
scoped_ptr<RendererSavePasswordProgressLogger> logger;
// From the perspective of saving passwords, only calls with |only_visible|
// being true are important -- the decision whether to save the password is
// only made after visible forms are known, for failed login detection. Calls
// with |only_visible| false are important for password form autofill, which
// is currently not part of the logging.
if (only_visible && logging_state_active_) {
if (logging_state_active_) {
logger.reset(new RendererSavePasswordProgressLogger(this, routing_id()));
logger->LogMessage(Logger::STRING_SEND_PASSWORD_FORMS_METHOD);
logger->LogBoolean(Logger::STRING_ONLY_VISIBLE, only_visible);
}
// Make sure that this security origin is allowed to use password manager.
......
......@@ -163,6 +163,8 @@ std::string GetStringFromID(SavePasswordProgressLogger::StringID id) {
return "No matching form";
case SavePasswordProgressLogger::STRING_SSL_ERRORS_PRESENT:
return "SSL errors present";
case SavePasswordProgressLogger::STRING_ONLY_VISIBLE:
return "only_visible";
case SavePasswordProgressLogger::STRING_INVALID:
return "INVALID";
// Intentionally no default: clause here -- all IDs need to get covered.
......
......@@ -100,6 +100,7 @@ class SavePasswordProgressLogger {
STRING_SAVING_DISABLED,
STRING_NO_MATCHING_FORM,
STRING_SSL_ERRORS_PRESENT,
STRING_ONLY_VISIBLE,
STRING_INVALID, // Represents a string returned in a case of an error.
STRING_MAX = STRING_INVALID
};
......
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