Index: chrome/browser/password_manager/password_manager.h |
diff --git a/chrome/browser/password_manager/password_manager.h b/chrome/browser/password_manager/password_manager.h |
index a0dbd7c3daeb848ca694a0be58ba96dc7548de7a..2e595c84e058f886ca3edc17ade6776aa21ab2ef 100644 |
--- a/chrome/browser/password_manager/password_manager.h |
+++ b/chrome/browser/password_manager/password_manager.h |
@@ -42,6 +42,19 @@ class PasswordManager : public LoginModel, |
PasswordManagerDelegate* delegate); |
virtual ~PasswordManager(); |
+ // Class that will be notified when a password form has been submitted. |
+ class SubmissionObserver { |
+ public: |
+ virtual void PasswordSubmitted(const content::PasswordForm& form) = 0; |
jam
2013/07/25 17:31:33
it's best to avoid single-method interfaces, you c
Garrett Casto
2013/07/25 20:00:01
Done.
|
+ |
+ protected: |
+ virtual ~SubmissionObserver() {} |
+ }; |
+ |
+ // There is no corresponding remove function, as currently all of the |
+ // SubmissionObservers have the same lifetime as the PasswordManager. |
+ void AddSubmissionObserver(SubmissionObserver* observer); |
+ |
// Is saving new data for password autofill enabled for the current profile? |
// For example, saving new data is disabled in Incognito mode, whereas filling |
// data is not. |
@@ -69,7 +82,7 @@ class PasswordManager : public LoginModel, |
void ProvisionallySavePassword(const content::PasswordForm& form); |
// content::WebContentsObserver overrides. |
- virtual void DidNavigateAnyFrame( |
+ virtual void DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) OVERRIDE; |
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
@@ -88,6 +101,10 @@ class PasswordManager : public LoginModel, |
private: |
friend class content::WebContentsUserData<PasswordManager>; |
+ friend class PasswordManagerTest; |
+ |
+ // Handle notification that a password form was submitted. |
+ void OnPasswordFormSubmitted(const content::PasswordForm& password_form); |
// Possibly set up FieldTrial for testing other possible usernames. This only |
// happens if there are other_possible_usernames to be shown and the |
@@ -134,9 +151,6 @@ class PasswordManager : public LoginModel, |
// containing WebContents. |
PasswordManagerDelegate* const delegate_; |
- // The LoginModelObserver (i.e LoginView) requiring autofill. |
- LoginModelObserver* observer_; |
- |
// Set to false to disable the password manager (will no longer ask if you |
// want to save passwords but will continue to fill passwords). |
BooleanPrefMember password_manager_enabled_; |
@@ -145,6 +159,9 @@ class PasswordManager : public LoginModel, |
// notification in const member functions. |
mutable ObserverList<LoginModelObserver> observers_; |
+ // Observers that wish to be notified when a password form has been submitted. |
+ ObserverList<SubmissionObserver> submission_observers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PasswordManager); |
}; |