Chromium Code Reviews| Index: components/autofill/core/browser/password_generator.cc |
| diff --git a/components/autofill/core/browser/password_generator.cc b/components/autofill/core/browser/password_generator.cc |
| index 84ca65edeb575612ddb646f0dba62a90365eaae6..dfab447f7e6243d307d6095b9dd2eec3b74e1fb8 100644 |
| --- a/components/autofill/core/browser/password_generator.cc |
| +++ b/components/autofill/core/browser/password_generator.cc |
| @@ -86,22 +86,15 @@ std::string PasswordGenerator::Generate() const { |
| // No special characters included for now. |
| unsigned int mode = S_NB | S_CL | S_SL; |
| - // gen_pron_pass() doesn't guarantee that it includes all of the type given |
| - // in mode, so regenerate a few times if neccessary. |
| - // TODO(gcasto): Is it worth regenerating at all? |
| - for (int i = 0; i < 10; ++i) { |
| - gen_pron_pass(password, unused_hypenated_password, |
| - password_length_, password_length_, mode); |
| - if (VerifyPassword(password)) |
| - return std::string(password); |
| - } |
| + // Generate the password by gen_pron_pass(), if it is not conforming then |
| + // force fix it. |
| + gen_pron_pass(password, unused_hypenated_password, password_length_, |
| + password_length_, mode); |
| + if (VerifyPassword(password)) |
| + return std::string(password); |
| - // If the password still isn't conforming after a few iterations, force it |
| - // to be so. This may change a syllable in the password. |
| std::string str_password(password); |
|
vabr (Chromium)
2015/12/02 11:43:09
Please move this just above line 93, then you can
Deepak
2015/12/02 12:51:18
Done.
|
| - if (!VerifyPassword(str_password)) { |
| - ForceFixPassword(&str_password); |
| - } |
| + ForceFixPassword(&str_password); |
| return str_password; |
| } |