Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6259)

Unified Diff: chrome/browser/password_manager/password_form_manager.h

Issue 23537029: Save password functionality added to the save password bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review 5 Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..064849fdf25178f136c6079ec19547a94e41217d 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,14 @@ 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().
+ // Called when navigation occurs or the tab is closed. Takes the necessary
+ // action with the form's login based on the desired |password_action_|.
void ApplyChange();
+ 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 +119,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 +135,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 +307,10 @@ class PasswordFormManager : public PasswordStoreConsumer {
ManagerAction manager_action_;
UserAction user_action_;
SubmitResult submit_result_;
- bool should_save_password_;
- bool should_blacklist_password_;
+
+ // Whether we should save, blacklist, or do nothing with this form's login
+ // on the next navigation or when the tab is closed.
+ PasswordAction password_action_;
DISALLOW_COPY_AND_ASSIGN(PasswordFormManager);
};

Powered by Google App Engine
This is Rietveld 408576698