Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: components/password_manager/core/browser/password_form_manager.h

Issue 2055633003: [Password Generation] Sends form classifier vote to autofill server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pg_form_classification
Patch Set: replaced " DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()) Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/password_form_manager.h
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h
index cfe2176d61eb77dc2222c5362121038902b76079..cc2a1a9cd32da25f564496721b651fe66e6a9545 100644
--- a/components/password_manager/core/browser/password_form_manager.h
+++ b/components/password_manager/core/browser/password_form_manager.h
@@ -271,6 +271,10 @@ class PasswordFormManager : public PasswordStoreConsumer {
// Called after successful login on the form with a generated password.
void ReplacePresavedPasswordWithPendingCredentials(PasswordStore* store);
+ // Saves the outcome of HTML parsing based form classifier to upload proto.
+ void SaveGenerationFieldDetectedByClassifier(
+ const base::string16& generation_field);
+
private:
// ManagerAction - What does the manager do with this form? Either it
// fills it, or it doesn't. If it doesn't fill it, that's either
@@ -325,6 +329,13 @@ class PasswordFormManager : public PasswordStoreConsumer {
kFormTypeMax
};
+ // The outcome of the form classifier.
+ enum FormClassifierOutcome {
+ kNoOutcome,
+ kNoGenerationElement,
+ kFoundGenerationElement
+ };
+
// The maximum number of combinations of the three preceding enums.
// This is used when recording the actions taken by the form in UMA.
static const int kMaxNumActionsTaken =
@@ -431,6 +442,9 @@ class PasswordFormManager : public PasswordStoreConsumer {
// Adds a vote on password generation usage to |form_structure|.
void AddGeneratedVote(autofill::FormStructure* form_structure);
+ // Adds a vote from HTML parsing based form classifier to |form_structure|.
+ void AddFormClassifierVote(autofill::FormStructure* form_structure);
+
// Create pending credentials from provisionally saved form and forms received
// from password store.
void CreatePendingCredentials();
@@ -526,6 +540,13 @@ class PasswordFormManager : public PasswordStoreConsumer {
// Whether generation popup was shown at least once.
bool generation_popup_was_shown_;
+ // The outcome of HTML parsing based form classifier.
+ FormClassifierOutcome form_classifier_outcome_;
+
+ // If |form_classifier_outcome_| == kFoundGenerationElement, the field
+ // contains the name of the detected generation element.
+ base::string16 generation_element_detected_by_classifier_;
+
// Whether the saved password was overridden.
bool password_overridden_;

Powered by Google App Engine
This is Rietveld 408576698