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

Unified Diff: components/autofill/content/renderer/password_generation_manager.h

Issue 23432002: Generate passwords only for forms that autofill server marks as account creation forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 years, 3 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/autofill/content/renderer/password_generation_manager.h
diff --git a/components/autofill/content/renderer/password_generation_manager.h b/components/autofill/content/renderer/password_generation_manager.h
index a61542861677bbef405e9fabb77c9ed2d9939b24..66c7171bf08a8499750f057bb6ed1c1cd9e050c7 100644
--- a/components/autofill/content/renderer/password_generation_manager.h
+++ b/components/autofill/content/renderer/password_generation_manager.h
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "base/memory/scoped_ptr.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/public/web/WebInputElement.h"
#include "third_party/WebKit/public/web/WebPasswordGeneratorClient.h"
@@ -19,6 +20,10 @@ class WebCString;
class WebDocument;
}
+namespace autofill {
+struct FormData;
+}
+
namespace content {
struct PasswordForm;
}
@@ -54,6 +59,8 @@ class PasswordGenerationManager : public content::RenderViewObserver,
void OnFormNotBlacklisted(const content::PasswordForm& form);
void OnPasswordAccepted(const base::string16& password);
void OnPasswordGenerationEnabled(bool enabled);
+ void OnAccountCreationFormsDetected(
+ const std::vector<autofill::FormData>& forms);
// Helper function to decide whether we should show password generation icon.
void MaybeShowIcon();
@@ -65,13 +72,17 @@ class PasswordGenerationManager : public content::RenderViewObserver,
bool enabled_;
// Stores the origin of the account creation form we detected.
- GURL account_creation_form_origin_;
+ scoped_ptr<content::PasswordForm> possible_account_creation_form_;
// Stores the origins of the password forms confirmed not to be blacklisted
// by the browser. A form can be blacklisted if a user chooses "never save
// passwords for this site".
std::vector<GURL> not_blacklisted_password_form_origins_;
+ // Stores the password form for which the Autofill server classifies one of
Ilya Sherman 2013/09/03 23:58:01 nit: "Stores the" -> "Stores each"
zysxqn 2013/09/04 17:26:20 Done.
+ // the form's fields as an ACCOUNT_CREATION_PASSWORD.
+ std::vector<autofill::FormData> account_creation_forms_;
+
std::vector<WebKit::WebInputElement> passwords_;
DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);

Powered by Google App Engine
This is Rietveld 408576698