Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "components/password_manager/core/browser/password_form_manager.h" | 8 #include "components/password_manager/core/browser/password_form_manager.h" |
| 9 #include "components/password_manager/core/browser/password_store.h" | 9 #include "components/password_manager/core/browser/password_store.h" |
| 10 #include "components/password_manager/core/browser/password_store_change.h" | 10 #include "components/password_manager/core/browser/password_store_change.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 virtual ~ManagePasswordsBubbleUIController(); | 27 virtual ~ManagePasswordsBubbleUIController(); |
| 28 | 28 |
| 29 // Called when the user submits a form containing login information, so we | 29 // Called when the user submits a form containing login information, so we |
| 30 // can handle later requests to save or blacklist that login information. | 30 // can handle later requests to save or blacklist that login information. |
| 31 // This stores the provided object in form_manager_ and triggers the UI to | 31 // This stores the provided object in form_manager_ and triggers the UI to |
| 32 // prompt the user about whether they would like to save the password. | 32 // prompt the user about whether they would like to save the password. |
| 33 void OnPasswordSubmitted(password_manager::PasswordFormManager* form_manager); | 33 void OnPasswordSubmitted(password_manager::PasswordFormManager* form_manager); |
| 34 | 34 |
| 35 // Called when a form is autofilled with login information, so we can manage | 35 // Called when a form is autofilled with login information, so we can manage |
| 36 // password credentials for the current site which are stored in | 36 // password credentials for the current site which are stored in |
| 37 // |password_form_map|. This stores a copy of |password_form_map| and shows | 37 // |map|. This stores a copy of |map| and shows the manage password icon. |
| 38 // the manage password icon. | |
| 39 void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map); | 38 void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map); |
|
vabr (Chromium)
2014/04/29 13:30:12
nit: Match the argument name (|map|) with the comm
Mike West
2014/04/30 10:39:32
Done.
| |
| 40 | 39 |
| 41 // Called when a form is _not_ autofilled due to user blacklisting. | 40 // Called when a form is _not_ autofilled due to user blacklisting. This |
| 42 void OnBlacklistBlockedAutofill(); | 41 // stores a copy of |map| so that we can offer the user the ability to |
| 42 // reenable the manager for this form. | |
| 43 void OnBlacklistBlockedAutofill( | |
| 44 const autofill::PasswordFormMap& password_form_map); | |
|
vabr (Chromium)
2014/04/29 13:30:12
ditto (argument name vs. comment)
Mike West
2014/04/30 10:39:32
Done.
| |
| 43 | 45 |
| 44 // PasswordStore::Observer implementation. | 46 // PasswordStore::Observer implementation. |
| 45 virtual void OnLoginsChanged( | 47 virtual void OnLoginsChanged( |
| 46 const password_manager::PasswordStoreChangeList& changes) OVERRIDE; | 48 const password_manager::PasswordStoreChangeList& changes) OVERRIDE; |
| 47 | 49 |
| 48 // Called from the model when the user chooses to save a password; passes the | 50 // Called from the model when the user chooses to save a password; passes the |
| 49 // action off to the FormManager. | 51 // action off to the FormManager. |
| 50 virtual void SavePassword(); | 52 virtual void SavePassword(); |
| 51 | 53 |
| 52 // Called from the model when the user chooses to never save passwords; passes | 54 // Called from the model when the user chooses to never save passwords; passes |
| 53 // the action off to the FormManager. | 55 // the action off to the FormManager. |
| 54 virtual void NeverSavePassword(); | 56 virtual void NeverSavePassword(); |
| 55 | 57 |
| 58 // Called from the model when the user chooses to unblacklist the site. | |
| 59 virtual void UnblacklistSite(); | |
| 60 | |
| 56 // Open a new tab, pointing to the password manager settings page. | 61 // Open a new tab, pointing to the password manager settings page. |
| 57 virtual void NavigateToPasswordManagerSettingsPage(); | 62 virtual void NavigateToPasswordManagerSettingsPage(); |
| 58 | 63 |
| 59 virtual const autofill::PasswordForm& PendingCredentials() const; | 64 virtual const autofill::PasswordForm& PendingCredentials() const; |
| 60 | 65 |
| 61 // Set the state of the Omnibox icon, and possibly show the associated bubble | 66 // Set the state of the Omnibox icon, and possibly show the associated bubble |
| 62 // without user interaction. | 67 // without user interaction. |
| 63 virtual void UpdateIconAndBubbleState(ManagePasswordsIcon* icon); | 68 virtual void UpdateIconAndBubbleState(ManagePasswordsIcon* icon); |
| 64 | 69 |
| 65 bool manage_passwords_icon_to_be_shown() const { | 70 bool manage_passwords_icon_to_be_shown() const { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 virtual void WebContentsDestroyed( | 113 virtual void WebContentsDestroyed( |
| 109 content::WebContents* web_contents) OVERRIDE; | 114 content::WebContents* web_contents) OVERRIDE; |
| 110 | 115 |
| 111 // Set by OnPasswordSubmitted() when the user submits a form containing login | 116 // Set by OnPasswordSubmitted() when the user submits a form containing login |
| 112 // information. If the user responds to a subsequent "Do you want to save | 117 // information. If the user responds to a subsequent "Do you want to save |
| 113 // this password?" prompt, we ask this object to save or blacklist the | 118 // this password?" prompt, we ask this object to save or blacklist the |
| 114 // associated login information in Chrome's password store. | 119 // associated login information in Chrome's password store. |
| 115 scoped_ptr<password_manager::PasswordFormManager> form_manager_; | 120 scoped_ptr<password_manager::PasswordFormManager> form_manager_; |
| 116 | 121 |
| 117 // All previously stored credentials for a specific site. Set by | 122 // All previously stored credentials for a specific site. Set by |
| 118 // OnPasswordSubmitted() or OnPasswordAutofilled(). | 123 // OnPasswordSubmitted(), OnPasswordAutofilled(), or |
| 124 // OnBlacklistBlockedAutofill(). | |
| 119 autofill::PasswordFormMap password_form_map_; | 125 autofill::PasswordFormMap password_form_map_; |
| 120 | 126 |
| 121 bool manage_passwords_icon_to_be_shown_; | 127 bool manage_passwords_icon_to_be_shown_; |
| 122 bool password_to_be_saved_; | 128 bool password_to_be_saved_; |
| 123 bool manage_passwords_bubble_needs_showing_; | 129 bool manage_passwords_bubble_needs_showing_; |
| 124 | 130 |
| 125 // Stores whether autofill was blocked due to a user's decision to blacklist | 131 // Stores whether autofill was blocked due to a user's decision to blacklist |
| 126 // the current site ("Never save passwords for this site"). | 132 // the current site ("Never save passwords for this site"). |
| 127 bool autofill_blocked_; | 133 bool autofill_blocked_; |
| 128 | 134 |
| 129 // The origin of the form we're currently dealing with; we'll use this to | 135 // The origin of the form we're currently dealing with; we'll use this to |
| 130 // determine which PasswordStore changes we should care about when updating | 136 // determine which PasswordStore changes we should care about when updating |
| 131 // |password_form_map_|. | 137 // |password_form_map_|. |
| 132 GURL origin_; | 138 GURL origin_; |
| 133 | 139 |
| 134 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleUIController); | 140 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleUIController); |
| 135 }; | 141 }; |
| 136 | 142 |
| 137 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 143 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| OLD | NEW |