| 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..fbae835bd0a0137c156cc366b845a78e738d4224 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 info_index) {
|
| + ProfileInfoCache& info =
|
| + g_browser_process->profile_manager()->GetProfileInfoCache();
|
| +
|
| + std::string encodedhash =
|
| + info.GetLocalAuthCredentialsOfProfileAtIndex(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) {
|
| + NOTREACHED(); // This should never happen but fail safely if it does.
|
| + return false;
|
| + }
|
| + return LocalAuthCredentialsExist(info_index);
|
| +
|
| +}
|
| +
|
| } // namespace chrome
|
|
|