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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; 47 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE;
48 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; 48 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE;
49 49
50 // WebPasswordGeneratorClient: 50 // WebPasswordGeneratorClient:
51 virtual void openPasswordGenerator(WebKit::WebInputElement& element) OVERRIDE; 51 virtual void openPasswordGenerator(WebKit::WebInputElement& element) OVERRIDE;
52 52
53 // Message handlers. 53 // Message handlers.
54 void OnFormNotBlacklisted(const content::PasswordForm& form); 54 void OnFormNotBlacklisted(const content::PasswordForm& form);
55 void OnPasswordAccepted(const base::string16& password); 55 void OnPasswordAccepted(const base::string16& password);
56 void OnPasswordGenerationEnabled(bool enabled); 56 void OnPasswordGenerationEnabled(bool enabled);
57 void OnAccountCreationFormsDetected(const std::vector<GURL>& origins);
57 58
58 // Helper function to decide whether we should show password generation icon. 59 // Helper function to decide whether we should show password generation icon.
59 void MaybeShowIcon(); 60 void MaybeShowIcon();
60 61
61 content::RenderView* render_view_; 62 content::RenderView* render_view_;
62 63
63 // True if password generation is enabled for the profile associated 64 // True if password generation is enabled for the profile associated
64 // with this renderer. 65 // with this renderer.
65 bool enabled_; 66 bool enabled_;
66 67
67 // Stores the origin of the account creation form we detected. 68 // Stores the origin of the account creation form we detected.
68 GURL account_creation_form_origin_; 69 GURL account_creation_form_origin_;
Ilya Sherman 2013/08/29 23:08:13 nit: Perhaps update this name to |possible_account
zysxqn 2013/09/03 23:00:20 Done.
69 70
70 // Stores the origins of the password forms confirmed not to be blacklisted 71 // Stores the origins of the password forms confirmed not to be blacklisted
71 // by the browser. A form can be blacklisted if a user chooses "never save 72 // by the browser. A form can be blacklisted if a user chooses "never save
72 // passwords for this site". 73 // passwords for this site".
73 std::vector<GURL> not_blacklisted_password_form_origins_; 74 std::vector<GURL> not_blacklisted_password_form_origins_;
74 75
76 // Stores the origins of the password forms that autofill server classifies
77 // one of its fields as ACCOUNT_CREATION_PASSWORD.
Ilya Sherman 2013/08/29 23:08:13 nit: Several small wording tweaks: "Stores the ori
zysxqn 2013/09/03 23:00:20 Done.
78 std::vector<GURL> autofill_account_creation_form_origins_;
79
75 std::vector<WebKit::WebInputElement> passwords_; 80 std::vector<WebKit::WebInputElement> passwords_;
76 81
77 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); 82 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);
78 }; 83 };
79 84
80 } // namespace autofill 85 } // namespace autofill
81 86
82 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_ 87 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698