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

Unified Diff: components/password_manager/core/browser/password_form_manager.cc

Issue 548953002: [Password Manager] Modified to support saving passwords on forms without username fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit-tests and fixed lint errors. Created 6 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: components/password_manager/core/browser/password_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index 6033da65ac42cb799550c4cc21a7b2244838b3fb..39198c85ce2c3de98d9d335df921f908709c5b80 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -5,6 +5,7 @@
#include "components/password_manager/core/browser/password_form_manager.h"
#include <algorithm>
+#include <set>
vabr (Chromium) 2014/09/15 13:01:45 Is this related to your other changes in the CL? I
Pritam Nikam 2014/09/15 15:02:08 Done. I've changed this to resolve Lint error. No
#include "base/metrics/histogram.h"
#include "base/metrics/user_metrics.h"
@@ -95,7 +96,7 @@ PasswordFormManager::~PasswordFormManager() {
int PasswordFormManager::GetActionsTaken() {
return user_action_ + kUserActionMax * (manager_action_ +
kManagerActionMax * submit_result_);
-};
+}
vabr (Chromium) 2014/09/15 13:01:45 Again, this does not seem related to the rest of t
Pritam Nikam 2014/09/15 15:02:08 Done. Ditto!
// TODO(timsteele): use a hash of some sort in the future?
PasswordFormManager::MatchResultMask PasswordFormManager::DoesManage(
@@ -226,11 +227,14 @@ bool PasswordFormManager::HasValidPasswordForm() {
// do not contain username_element and password_element values.
if (observed_form_.scheme != PasswordForm::SCHEME_HTML)
return true;
- return !observed_form_.username_element.empty() &&
- (!observed_form_.password_element.empty() ||
+ return (!observed_form_.password_element.empty() ||
!observed_form_.new_password_element.empty());
}
+bool PasswordFormManager::HasValidLogin() {
+ return !observed_form_.username_element.empty();
+}
+
void PasswordFormManager::ProvisionallySave(
const PasswordForm& credentials,
OtherPossibleUsernamesAction action) {

Powered by Google App Engine
This is Rietveld 408576698