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 d65d1c7d449d5c2d7ca9280649eca73ad3e28a67..2632288ea9c661e7de59018f42b643f88bb4b247 100644 |
--- a/chrome/browser/password_manager/password_manager.h |
+++ b/chrome/browser/password_manager/password_manager.h |
@@ -7,6 +7,7 @@ |
#include <vector> |
+#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_vector.h" |
#include "base/observer_list.h" |
@@ -42,6 +43,14 @@ class PasswordManager : public LoginModel, |
PasswordManagerDelegate* delegate); |
virtual ~PasswordManager(); |
+ typedef base::Callback<void(const content::PasswordForm&)> |
+ PasswordSubmittedCallback; |
+ |
+ // There is no corresponding remove function as currently all of the |
+ // owners of these callbacks have sufficient lifetimes so that the callbacks |
+ // should always be valid when called. |
+ void AddSubmissionCallback(const PasswordSubmittedCallback& callback); |
+ |
// 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 +78,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; |
@@ -86,6 +95,10 @@ class PasswordManager : public LoginModel, |
PasswordManager(content::WebContents* web_contents, |
PasswordManagerDelegate* delegate); |
+ // Handle notification that a password form was submitted. |
+ virtual void OnPasswordFormSubmitted( |
+ const content::PasswordForm& password_form); |
+ |
private: |
friend class content::WebContentsUserData<PasswordManager>; |
@@ -142,6 +155,9 @@ class PasswordManager : public LoginModel, |
// notification in const member functions. |
mutable ObserverList<LoginModelObserver> observers_; |
+ // Callbacks to be notified when a password form has been submitted. |
+ std::vector<PasswordSubmittedCallback> submission_callbacks_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PasswordManager); |
}; |