Index: chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h |
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h |
index 16b717d2599caa1347ec8b13a419565203bfc921..6a4d8761337971c853fe780d8752fe8e8cf5216a 100644 |
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h |
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h |
@@ -6,6 +6,8 @@ |
#define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
#include "components/password_manager/core/browser/password_form_manager.h" |
+#include "components/password_manager/core/browser/password_store.h" |
+#include "components/password_manager/core/browser/password_store_change.h" |
#include "content/public/browser/navigation_details.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
@@ -17,7 +19,8 @@ class WebContents; |
// Per-tab class to control the Omnibox password icon and bubble. |
class ManagePasswordsBubbleUIController |
: public content::WebContentsObserver, |
- public content::WebContentsUserData<ManagePasswordsBubbleUIController> { |
+ public content::WebContentsUserData<ManagePasswordsBubbleUIController>, |
+ public password_manager::PasswordStore::Observer { |
public: |
virtual ~ManagePasswordsBubbleUIController(); |
@@ -36,12 +39,9 @@ class ManagePasswordsBubbleUIController |
// Called when a form is _not_ autofilled due to user blacklisting. |
void OnBlacklistBlockedAutofill(); |
- // TODO(npentrel) This ought to be changed. Best matches should be newly |
- // made when opening the ManagePasswordsBubble because there may have been |
- // changes to the best matches via the settings page. At the moment this also |
- // fails if one deletes a password when they are autofilled, as it still shows |
- // up after logging in and saving a password. |
- void RemoveFromBestMatches(autofill::PasswordForm password_form); |
+ // PasswordStore::Observer implementation. |
+ virtual void OnLoginsChanged( |
+ const password_manager::PasswordStoreChangeList& changes) OVERRIDE; |
void SavePassword(); |
@@ -79,14 +79,6 @@ class ManagePasswordsBubbleUIController |
return password_form_map_; |
} |
- bool password_submitted() const { |
- return password_submitted_; |
- } |
- |
- void set_password_submitted(bool password_submitted) { |
- password_submitted_ = password_submitted; |
- } |
- |
bool autofill_blocked() const { return autofill_blocked_; } |
void set_autofill_blocked(bool autofill_blocked) { |
autofill_blocked_ = autofill_blocked; |
@@ -107,6 +99,8 @@ class ManagePasswordsBubbleUIController |
virtual void DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) OVERRIDE; |
+ virtual void WebContentsDestroyed( |
+ content::WebContents* web_contents) OVERRIDE; |
// Set by OnPasswordSubmitted() when the user submits a form containing login |
// information. If the user responds to a subsequent "Do you want to save |
@@ -121,14 +115,16 @@ class ManagePasswordsBubbleUIController |
bool manage_passwords_icon_to_be_shown_; |
bool password_to_be_saved_; |
bool manage_passwords_bubble_needs_showing_; |
- // Stores whether a new password has been submitted, if so we have |
- // |pending_credentials|. |
- bool password_submitted_; |
// Stores whether autofill was blocked due to a user's decision to blacklist |
// the current site ("Never save passwords for this site"). |
bool autofill_blocked_; |
+ // The origin of the form we're currently dealing with; we'll use this to |
+ // determine which PasswordStore changes we should care about when updating |
+ // |password_form_map_|. |
+ GURL origin_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleUIController); |
}; |