Chromium Code Reviews| Index: chrome/browser/password_manager/password_form_manager.h |
| diff --git a/chrome/browser/password_manager/password_form_manager.h b/chrome/browser/password_manager/password_form_manager.h |
| index 1735032bd4239c43d4295cb822429f3aab6c28cd..e959125eb395375375d1a81a3e352c7496f77a1a 100644 |
| --- a/chrome/browser/password_manager/password_form_manager.h |
| +++ b/chrome/browser/password_manager/password_form_manager.h |
| @@ -49,6 +49,12 @@ class PasswordFormManager : public PasswordStoreConsumer { |
| IGNORE_OTHER_POSSIBLE_USERNAMES |
| }; |
| + enum PasswordAction { |
| + DO_NOTHING, |
| + SAVE, |
| + BLACKLIST |
| + }; |
| + |
| // Compare basic data of observed_form_ with argument. Only check the action |
| // URL when action match is required. |
| bool DoesManage(const autofill::PasswordForm& form, |
| @@ -71,18 +77,15 @@ class PasswordFormManager : public PasswordStoreConsumer { |
| // the same thread! |
| bool HasCompletedMatching(); |
| - // Sets current password to be saved when ApplyEdits() is called. Will |
| - // override a previous call to BlacklistPassword(). |
| - void SavePassword(); |
| - |
| - // Sets current password to be blacklisted when ApplyEdits() is called. Will |
| - // override a previous call to SavePassword(). |
| - void BlacklistPassword(); |
| - |
| - // Persist changes from the latest call to either SavePassword() or |
| - // BlacklistPassword(). |
| + // Persist changes according to the state of |password_action_| when the next |
| + // navigation occurs or when the tab is closed. |
|
Peter Kasting
2013/09/11 21:49:39
Nit: How about:
Called when the page is navigated
npentrel
2013/09/12 10:08:44
Done.
|
| void ApplyChange(); |
| + // Record state of |password_action_|. |
|
Peter Kasting
2013/09/11 21:49:39
This comment is misleading. Just remove it entire
npentrel
2013/09/12 10:08:44
Done.
|
| + void set_password_action(PasswordAction password_action) { |
| + password_action_ = password_action; |
| + } |
| + |
| // Determines if the user opted to 'never remember' passwords for this form. |
| bool IsBlacklisted(); |
| @@ -117,7 +120,6 @@ class PasswordFormManager : public PasswordStoreConsumer { |
| // A user opted to 'never remember' passwords for this form. |
| // Blacklist it so that from now on when it is seen we ignore it. |
| - |
| // TODO: Make this private once we switch to the new UI. |
| void PermanentlyBlacklist(); |
| @@ -134,7 +136,6 @@ class PasswordFormManager : public PasswordStoreConsumer { |
| // Handles save-as-new or update of the form managed by this manager. |
| // Note the basic data of updated_credentials must match that of |
| // observed_form_ (e.g DoesManage(pending_credentials_) == true). |
| - |
| // TODO: Make this private once we switch to the new UI. |
| void Save(); |
| @@ -307,8 +308,10 @@ class PasswordFormManager : public PasswordStoreConsumer { |
| ManagerAction manager_action_; |
| UserAction user_action_; |
| SubmitResult submit_result_; |
| - bool should_save_password_; |
| - bool should_blacklist_password_; |
| + |
| + // This field records what the user wants us to do with the used login |
| + // credentials. The action gets applied with ApplyChange(). |
|
Peter Kasting
2013/09/11 21:49:39
Nit: How about:
Whether we should save, blacklist
npentrel
2013/09/12 10:08:44
Done.
|
| + PasswordAction password_action_; |
| DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| }; |