Chromium Code Reviews| Index: chrome/browser/signin/local_auth.cc |
| diff --git a/chrome/browser/signin/local_auth.cc b/chrome/browser/signin/local_auth.cc |
| index 55b955e25fd7a467bac1959d3637ea8ddec4ad32..0362afe3830fa7fec8eca48a03ad055a13c8ad0a 100644 |
| --- a/chrome/browser/signin/local_auth.cc |
| +++ b/chrome/browser/signin/local_auth.cc |
| @@ -198,4 +198,28 @@ bool ValidateLocalAuthCredentials(const Profile* profile, |
| return ValidateLocalAuthCredentials(info_index, password); |
| } |
| +bool LocalAuthCredentialsExist(size_t profile_info_index) { |
| + ProfileInfoCache& info = |
| + g_browser_process->profile_manager()->GetProfileInfoCache(); |
| + |
| + std::string encodedhash = |
| + info.GetLocalAuthCredentialsOfProfileAtIndex(profile_info_index); |
| + |
| + return !encodedhash.empty(); |
| +} |
| + |
| +bool LocalAuthCredentialsExist(const Profile* profile) { |
| + DCHECK(profile); |
| + |
| + ProfileInfoCache& info = |
| + g_browser_process->profile_manager()->GetProfileInfoCache(); |
| + size_t info_index = info.GetIndexOfProfileWithPath(profile->GetPath()); |
| + if (info_index == std::string::npos) { |
|
msw
2014/08/22 21:46:48
Should this logic be in the |profile_info_index| f
Mike Lerman
2014/08/25 14:44:30
I turned the NOTREACHED into a DCHECK and put it o
msw
2014/08/25 17:39:54
I appreciate the cleanup, but you've removed the "
Mike Lerman
2014/08/25 18:11:37
Did I? The DCHECK(profile) is now in the common me
msw
2014/08/25 18:54:03
The early return [false] statements. The old code
Mike Lerman
2014/08/25 19:05:11
Gotcha, done.
|
| + NOTREACHED(); // This should never happen but fail safely if it does. |
| + return false; |
| + } |
| + return LocalAuthCredentialsExist(info_index); |
| + |
|
msw
2014/08/22 21:46:48
nit: remove blank line.
Mike Lerman
2014/08/25 14:44:30
Done.
|
| +} |
| + |
| } // namespace chrome |