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 0552893c528a1ae72f69d7be1b262573fb7e66e9..e55761c5fae40dd013723c08d24ae579db6b1a1a 100644 |
--- a/chrome/browser/password_manager/password_manager.h |
+++ b/chrome/browser/password_manager/password_manager.h |
@@ -6,7 +6,10 @@ |
#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
#pragma once |
+#include <vector> |
+ |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/stl_util.h" |
#include "chrome/browser/password_manager/password_form_manager.h" |
#include "chrome/browser/prefs/pref_member.h" |
@@ -38,16 +41,18 @@ class PasswordManager : public LoginModel, |
// on the page. |
void Autofill(const webkit::forms::PasswordForm& form_for_autofill, |
const webkit::forms::PasswordFormMap& best_matches, |
- const webkit::forms::PasswordForm* const preferred_match, |
+ const webkit::forms::PasswordForm& preferred_match, |
bool wait_for_username) const; |
// LoginModel implementation. |
virtual void SetObserver(LoginModelObserver* observer) OVERRIDE; |
+ // TODO(isherman): This should not be public, but is currently being used by |
+ // the LoginPrompt code. |
Ilya Sherman
2012/03/02 02:51:50
Incidentally, I'm rather confused as to how the Lo
|
// When a form is submitted, we prepare to save the password but wait |
// until we decide the user has successfully logged in. This is step 1 |
// of 2 (see SavePassword). |
- void ProvisionallySavePassword(webkit::forms::PasswordForm form); |
+ void ProvisionallySavePassword(const webkit::forms::PasswordForm& form); |
// content::WebContentsObserver overrides. |
virtual void DidStopLoading() OVERRIDE; |
@@ -56,14 +61,14 @@ class PasswordManager : public LoginModel, |
const content::FrameNavigateParams& params) OVERRIDE; |
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
+ // TODO(isherman): This should not be public, but is currently being used by |
+ // the LoginPrompt code. |
void OnPasswordFormsFound( |
const std::vector<webkit::forms::PasswordForm>& forms); |
void OnPasswordFormsVisible( |
const std::vector<webkit::forms::PasswordForm>& visible_forms); |
private: |
- FRIEND_TEST_ALL_PREFIXES(PasswordManagerTest, FormSeenThenLeftPage); |
- |
// Note about how a PasswordFormManager can transition from |
// pending_login_managers_ to provisional_save_manager_ and the infobar. |
// |
@@ -78,20 +83,10 @@ class PasswordManager : public LoginModel, |
// When a form is "seen" on a page, a PasswordFormManager is created |
// and stored in this collection until user navigates away from page. |
- // Clear any pending saves |
- void ClearProvisionalSave(); |
- |
- // Notification that the user navigated away from the current page. |
- // Unless this is a password form submission, for our purposes this |
- // means we're done with the current page, so we can clean-up. |
- void DidNavigate(); |
- |
- typedef std::vector<PasswordFormManager*> LoginManagers; |
- LoginManagers pending_login_managers_; |
+ // Is password autofill enabled for the current profile? |
+ bool IsEnabled() const; |
- // Deleter for pending_login_managers_ when PasswordManager is deleted (e.g |
- // tab closes) on a page with a password form, thus containing login managers. |
- STLElementDeleter<LoginManagers> login_managers_deleter_; |
+ ScopedVector<PasswordFormManager> pending_login_managers_; |
// When the user submits a password/credential, this contains the |
// PasswordFormManager for the form in question until we deem the login |
@@ -103,7 +98,7 @@ class PasswordManager : public LoginModel, |
// Our delegate for carrying out external operations. This is typically the |
// containing TabContents. |
- PasswordManagerDelegate* delegate_; |
+ PasswordManagerDelegate* const delegate_; |
// The LoginModelObserver (i.e LoginView) requiring autofill. |
LoginModelObserver* observer_; |