Chromium Code Reviews| 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 e7e7118550e3507137109768950d7c3184172a15..dc9e904370ee2cb37967fd3ed5b79b49f27031a2 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 PasswordStore::Observer { |
| public: |
| virtual ~ManagePasswordsBubbleUIController(); |
| @@ -36,12 +39,8 @@ 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 PasswordStoreChangeList& changes) OVERRIDE; |
| void SavePassword(); |
| @@ -79,14 +78,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 +98,11 @@ class ManagePasswordsBubbleUIController |
| virtual void DidNavigateMainFrame( |
| const content::LoadCommittedDetails& details, |
| const content::FrameNavigateParams& params) OVERRIDE; |
| + virtual void WebContentsDestroyed( |
| + content::WebContents* web_contents) OVERRIDE; |
| + |
| + // Returns the password store associated with the web_contents. |
| + PasswordStore* GetPasswordStore(content::WebContents* web_contents); |
|
vabr (Chromium)
2014/04/08 13:08:34
Could this be (in order of my preference):
1) a he
Mike West
2014/04/09 07:06:51
A helper method in the anonymous namespace it is!
|
| // 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 +117,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); |
| }; |